Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DebugConsole::ChangeVariable( std::string command ) {
- char *name = new char(), *buf = new char();
- std::vector< DcVariableInformation >::iterator itr;
- sscanf( command.c_str(), "#%s %s", name, buf );
- for( itr = Variables.begin(); itr != Variables.end(); ++itr ) {
- if( std::string( ( *itr ).name ) == std::string( name ) ) {
- switch( ( *itr ).type ) {
- case DC_BYTE:
- *( char* )( ( *itr ).variable ) = BCL::Typecasting::PcToInt( buf );
- case DC_INT:
- *( int* )( ( *itr ).variable ) = BCL::Typecasting::PcToInt( buf );
- case DC_FLOAT:
- *( float* )( ( *itr ).variable ) = BCL::Typecasting::PcToFlt( buf );
- case DC_PCHAR:
- ( *itr ).variable = ( void * )buf;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment