Changeset 6422
- Timestamp:
- Dec 26, 2009, 11:18:13 AM (15 years ago)
- Location:
- code/trunk/src/libraries/core
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/ConfigFileManager.cc
r6417 r6422 489 489 ConfigFileManager::~ConfigFileManager() 490 490 { 491 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); )491 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ) 492 492 delete (it++)->second; 493 493 } … … 507 507 void ConfigFileManager::load() 508 508 { 509 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)509 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it) 510 510 it->second->load(); 511 511 } … … 513 513 void ConfigFileManager::save() 514 514 { 515 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)515 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it) 516 516 it->second->save(); 517 517 } … … 519 519 void ConfigFileManager::clean(bool bCleanComments) 520 520 { 521 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)521 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it) 522 522 this->clean(it->first, bCleanComments); 523 523 } … … 545 545 void ConfigFileManager::updateConfigValues() 546 546 { 547 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)547 for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it) 548 548 it->second->updateConfigValues(); 549 549 } -
code/trunk/src/libraries/core/DynLibManager.cc
r6073 r6422 75 75 { 76 76 // Unload & delete resources in turn 77 for ( DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it)77 for (DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it) 78 78 { 79 79 it->second->unload(); -
code/trunk/src/libraries/core/Game.cc
r6417 r6422 445 445 { 446 446 int indentation = 0; 447 while (pos < str.size() && str[pos] == ' ')447 while (pos < str.size() && str[pos] == ' ') 448 448 ++indentation, ++pos; 449 449 startPos = pos; 450 while (pos < str.size() && str[pos] != ' ')450 while (pos < str.size() && str[pos] != ' ') 451 451 ++pos; 452 452 stateStrings.push_back(std::make_pair(str.substr(startPos, pos - startPos), indentation)); -
code/trunk/src/libraries/core/IOConsole.cc
r6417 r6422 345 345 /*static*/ void IOConsole::resetTerminalMode() 346 346 { 347 if (IOConsole::singletonPtr_s && IOConsole::singletonPtr_s->originalTerminalSettings_)347 if (IOConsole::singletonPtr_s && IOConsole::singletonPtr_s->originalTerminalSettings_) 348 348 { 349 349 tcsetattr(0, TCSANOW, IOConsole::singletonPtr_s->originalTerminalSettings_); -
code/trunk/src/libraries/core/Loader.cc
r6417 r6422 244 244 { 245 245 it2++; 246 if (it->second && !(it2->second) && it2->first < pos)246 if (it->second && !(it2->second) && it2->first < pos) 247 247 it = ++it2; 248 248 else … … 307 307 unsigned int tempCounter = 1; 308 308 size_t tempPos = pos++; 309 while (temp[++tempPos] == '=')309 while (temp[++tempPos] == '=') 310 310 { 311 311 tempCounter++; 312 312 } 313 if (temp[tempPos] != '[')313 if (temp[tempPos] != '[') 314 314 { 315 315 tempCounter = 0; 316 316 } 317 else if (tempCounter == 0)317 else if (tempCounter == 0) 318 318 { 319 319 tempCounter = 1; … … 329 329 unsigned int tempCounter = 1; 330 330 size_t tempPos = pos++; 331 while (temp[++tempPos] == '=')331 while (temp[++tempPos] == '=') 332 332 { 333 333 tempCounter++; 334 334 } 335 if (temp[tempPos] != ']')335 if (temp[tempPos] != ']') 336 336 { 337 337 tempCounter = 0; 338 338 } 339 else if (tempCounter == 0)339 else if (tempCounter == 0) 340 340 { 341 341 tempCounter = 1; … … 346 346 } 347 347 std::string equalSigns; 348 for (unsigned int i = 0; i < equalSignCounter; i++)348 for (unsigned int i = 0; i < equalSignCounter; i++) 349 349 { 350 350 equalSigns += '='; -
code/trunk/src/libraries/core/input/InputManager.cc
r6417 r6422 404 404 { 405 405 // Get smallest possible priority between 1 and maxStateStackSize_s 406 for (std::map<int, InputState*>::reverse_iterator rit = activeStates_.rbegin();406 for (std::map<int, InputState*>::reverse_iterator rit = activeStates_.rbegin(); 407 407 rit != activeStates_.rend(); ++rit) 408 408 { -
code/trunk/src/libraries/core/input/KeyBinder.cc
r6417 r6422 291 291 std::vector<std::string>& oldKeynames = this->allCommands_[button->bindingString_]; 292 292 std::vector<std::string>::iterator it = std::find(oldKeynames.begin(), oldKeynames.end(), stream.str()); 293 if(it != oldKeynames.end()) 294 { 293 if (it != oldKeynames.end()) 295 294 oldKeynames.erase(it); 296 }297 295 298 296 if (!command.empty()) 299 297 { 300 298 std::vector<std::string>& keynames = this->allCommands_[command]; 301 if( std::find(keynames.begin(), keynames.end(), stream.str()) == keynames.end()) 302 { 299 if (std::find(keynames.begin(), keynames.end(), stream.str()) == keynames.end()) 303 300 this->allCommands_[command].push_back(stream.str()); 304 }305 301 } 306 302 } … … 312 308 const std::string& KeyBinder::getBinding(const std::string& commandName) 313 309 { 314 if (this->allCommands_.find(commandName) != this->allCommands_.end())310 if (this->allCommands_.find(commandName) != this->allCommands_.end()) 315 311 { 316 312 std::vector<std::string>& keynames = this->allCommands_[commandName]; … … 331 327 const std::string& KeyBinder::getBinding(const std::string& commandName, unsigned int index) 332 328 { 333 if (this->allCommands_.find(commandName) != this->allCommands_.end())329 if (this->allCommands_.find(commandName) != this->allCommands_.end()) 334 330 { 335 331 std::vector<std::string>& keynames = this->allCommands_[commandName]; 336 if(index < keynames.size()) 337 { 332 if (index < keynames.size()) 338 333 return keynames[index]; 339 }340 334 341 335 return BLANKSTRING; … … 353 347 unsigned int KeyBinder::getNumberOfBindings(const std::string& commandName) 354 348 { 355 if (this->allCommands_.find(commandName) != this->allCommands_.end())349 if (this->allCommands_.find(commandName) != this->allCommands_.end()) 356 350 { 357 351 std::vector<std::string>& keynames = this->allCommands_[commandName]; -
code/trunk/src/libraries/core/input/Keyboard.cc
r6417 r6422 36 36 { 37 37 // update modifiers 38 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU)38 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU) 39 39 modifiers_ |= KeyboardModifier::Alt; // alt key 40 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)40 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL) 41 41 modifiers_ |= KeyboardModifier::Ctrl; // ctrl key 42 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT)42 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT) 43 43 modifiers_ |= KeyboardModifier::Shift; // shift key 44 44 … … 56 56 { 57 57 // update modifiers 58 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU)58 if (arg.key == OIS::KC_RMENU || arg.key == OIS::KC_LMENU) 59 59 modifiers_ &= ~KeyboardModifier::Alt; // alt key 60 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)60 if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL) 61 61 modifiers_ &= ~KeyboardModifier::Ctrl; // ctrl key 62 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT)62 if (arg.key == OIS::KC_RSHIFT || arg.key == OIS::KC_LSHIFT) 63 63 modifiers_ &= ~KeyboardModifier::Shift; // shift key 64 64
Note: See TracChangeset
for help on using the changeset viewer.