[Orxonox-commit 1704] r6422 - in code/trunk/src/libraries/core: . input

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Dec 26 11:18:13 CET 2009


Author: rgrieder
Date: 2009-12-26 11:18:13 +0100 (Sat, 26 Dec 2009)
New Revision: 6422

Modified:
   code/trunk/src/libraries/core/ConfigFileManager.cc
   code/trunk/src/libraries/core/DynLibManager.cc
   code/trunk/src/libraries/core/Game.cc
   code/trunk/src/libraries/core/IOConsole.cc
   code/trunk/src/libraries/core/Loader.cc
   code/trunk/src/libraries/core/input/InputManager.cc
   code/trunk/src/libraries/core/input/KeyBinder.cc
   code/trunk/src/libraries/core/input/Keyboard.cc
Log:
Uniform code-styling per file. As if I didn't know what to do ^^

Modified: code/trunk/src/libraries/core/ConfigFileManager.cc
===================================================================
--- code/trunk/src/libraries/core/ConfigFileManager.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/ConfigFileManager.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -488,7 +488,7 @@
 
     ConfigFileManager::~ConfigFileManager()
     {
-        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); )
+        for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); )
             delete (it++)->second;
     }
 
@@ -506,19 +506,19 @@
 
     void ConfigFileManager::load()
     {
-        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+        for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
             it->second->load();
     }
 
     void ConfigFileManager::save()
     {
-        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+        for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
             it->second->save();
     }
 
     void ConfigFileManager::clean(bool bCleanComments)
     {
-        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+        for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
             this->clean(it->first, bCleanComments);
     }
 
@@ -544,7 +544,7 @@
 
     void ConfigFileManager::updateConfigValues()
     {
-        for(std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
+        for (std::map<ConfigFileType, ConfigFile*>::const_iterator it = this->configFiles_.begin(); it != this->configFiles_.end(); ++it)
             it->second->updateConfigValues();
     }
 

Modified: code/trunk/src/libraries/core/DynLibManager.cc
===================================================================
--- code/trunk/src/libraries/core/DynLibManager.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/DynLibManager.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -74,7 +74,7 @@
     DynLibManager::~DynLibManager()
     {
         // Unload & delete resources in turn
-        for( DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it )
+        for (DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it)
         {
             it->second->unload();
             delete it->second;

Modified: code/trunk/src/libraries/core/Game.cc
===================================================================
--- code/trunk/src/libraries/core/Game.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/Game.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -444,10 +444,10 @@
         while (pos < str.size())
         {
             int indentation = 0;
-            while(pos < str.size() && str[pos] == ' ')
+            while (pos < str.size() && str[pos] == ' ')
                 ++indentation, ++pos;
             startPos = pos;
-            while(pos < str.size() && str[pos] != ' ')
+            while (pos < str.size() && str[pos] != ' ')
                 ++pos;
             stateStrings.push_back(std::make_pair(str.substr(startPos, pos - startPos), indentation));
         }

Modified: code/trunk/src/libraries/core/IOConsole.cc
===================================================================
--- code/trunk/src/libraries/core/IOConsole.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/IOConsole.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -344,7 +344,7 @@
 
     /*static*/ void IOConsole::resetTerminalMode()
     {
-        if(IOConsole::singletonPtr_s && IOConsole::singletonPtr_s->originalTerminalSettings_)
+        if (IOConsole::singletonPtr_s && IOConsole::singletonPtr_s->originalTerminalSettings_)
         {
             tcsetattr(0, TCSANOW, IOConsole::singletonPtr_s->originalTerminalSettings_);
             delete IOConsole::singletonPtr_s->originalTerminalSettings_;

Modified: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/Loader.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -243,7 +243,7 @@
                     if (bBetweenQuotes)
                     {
                         it2++;
-                        if(it->second && !(it2->second) && it2->first < pos)
+                        if (it->second && !(it2->second) && it2->first < pos)
                             it = ++it2;
                         else
                             luaTags.erase(it++);
@@ -306,15 +306,15 @@
                     {
                         unsigned int tempCounter = 1;
                         size_t tempPos = pos++;
-                        while(temp[++tempPos] == '=')
+                        while (temp[++tempPos] == '=')
                         {
                             tempCounter++;
                         }
-                        if(temp[tempPos] != '[')
+                        if (temp[tempPos] != '[')
                         {
                             tempCounter = 0;
                         }
-                        else if(tempCounter == 0)
+                        else if (tempCounter == 0)
                         {
                             tempCounter = 1;
                         }
@@ -328,15 +328,15 @@
                         {
                             unsigned int tempCounter = 1;
                             size_t tempPos = pos++;
-                            while(temp[++tempPos] == '=')
+                            while (temp[++tempPos] == '=')
                             {
                                 tempCounter++;
                             }
-                            if(temp[tempPos] != ']')
+                            if (temp[tempPos] != ']')
                             {
                                 tempCounter = 0;
                             }
-                            else if(tempCounter == 0)
+                            else if (tempCounter == 0)
                             {
                                 tempCounter = 1;
                             }
@@ -345,7 +345,7 @@
                         }
                     }
                     std::string equalSigns;
-                    for(unsigned int i = 0; i < equalSignCounter; i++)
+                    for (unsigned int i = 0; i < equalSignCounter; i++)
                     {
                         equalSigns += '=';
                     }

Modified: code/trunk/src/libraries/core/input/InputManager.cc
===================================================================
--- code/trunk/src/libraries/core/input/InputManager.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/input/InputManager.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -403,7 +403,7 @@
                 if ((*it)->getPriority() == 0)
                 {
                     // Get smallest possible priority between 1 and maxStateStackSize_s
-                    for(std::map<int, InputState*>::reverse_iterator rit = activeStates_.rbegin();
+                    for (std::map<int, InputState*>::reverse_iterator rit = activeStates_.rbegin();
                         rit != activeStates_.rend(); ++rit)
                     {
                         if (rit->first < InputStatePriority::HighPriority)

Modified: code/trunk/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/trunk/src/libraries/core/input/KeyBinder.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/input/KeyBinder.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -290,18 +290,14 @@
 
         std::vector<std::string>& oldKeynames = this->allCommands_[button->bindingString_];
         std::vector<std::string>::iterator it = std::find(oldKeynames.begin(), oldKeynames.end(), stream.str());
-        if(it != oldKeynames.end())
-        {
+        if (it != oldKeynames.end())
             oldKeynames.erase(it);
-        }
 
         if (!command.empty())
         {
             std::vector<std::string>& keynames = this->allCommands_[command];
-            if( std::find(keynames.begin(), keynames.end(), stream.str()) == keynames.end())
-            {
+            if (std::find(keynames.begin(), keynames.end(), stream.str()) == keynames.end())
                 this->allCommands_[command].push_back(stream.str());
-            }
         }
      }
 
@@ -311,7 +307,7 @@
     */
     const std::string& KeyBinder::getBinding(const std::string& commandName)
     {
-        if( this->allCommands_.find(commandName) != this->allCommands_.end())
+        if (this->allCommands_.find(commandName) != this->allCommands_.end())
         {
             std::vector<std::string>& keynames = this->allCommands_[commandName];
             return keynames.front();
@@ -330,13 +326,11 @@
     */
     const std::string& KeyBinder::getBinding(const std::string& commandName, unsigned int index)
     {
-        if( this->allCommands_.find(commandName) != this->allCommands_.end())
+        if (this->allCommands_.find(commandName) != this->allCommands_.end())
         {
             std::vector<std::string>& keynames = this->allCommands_[commandName];
-            if(index < keynames.size())
-            {
+            if (index < keynames.size())
                 return keynames[index];
-            }
 
             return BLANKSTRING;
         }
@@ -352,7 +346,7 @@
     */
     unsigned int KeyBinder::getNumberOfBindings(const std::string& commandName)
     {
-        if( this->allCommands_.find(commandName) != this->allCommands_.end())
+        if (this->allCommands_.find(commandName) != this->allCommands_.end())
         {
             std::vector<std::string>& keynames = this->allCommands_[commandName];
             return keynames.size();

Modified: code/trunk/src/libraries/core/input/Keyboard.cc
===================================================================
--- code/trunk/src/libraries/core/input/Keyboard.cc	2009-12-26 09:06:54 UTC (rev 6421)
+++ code/trunk/src/libraries/core/input/Keyboard.cc	2009-12-26 10:18:13 UTC (rev 6422)
@@ -35,11 +35,11 @@
     bool Keyboard::keyPressed(const OIS::KeyEvent& arg)
     {
         // update modifiers
-        if(arg.key == OIS::KC_RMENU    || arg.key == OIS::KC_LMENU)
+        if (arg.key == OIS::KC_RMENU    || arg.key == OIS::KC_LMENU)
             modifiers_ |= KeyboardModifier::Alt;   // alt key
-        if(arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)
+        if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)
             modifiers_ |= KeyboardModifier::Ctrl;  // ctrl key
-        if(arg.key == OIS::KC_RSHIFT   || arg.key == OIS::KC_LSHIFT)
+        if (arg.key == OIS::KC_RSHIFT   || arg.key == OIS::KC_LSHIFT)
             modifiers_ |= KeyboardModifier::Shift; // shift key
 
         // Do not distribute the alt+tab event (messes with the operating system)
@@ -55,11 +55,11 @@
     bool Keyboard::keyReleased(const OIS::KeyEvent& arg)
     {
         // update modifiers
-        if(arg.key == OIS::KC_RMENU    || arg.key == OIS::KC_LMENU)
+        if (arg.key == OIS::KC_RMENU    || arg.key == OIS::KC_LMENU)
             modifiers_ &= ~KeyboardModifier::Alt;   // alt key
-        if(arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)
+        if (arg.key == OIS::KC_RCONTROL || arg.key == OIS::KC_LCONTROL)
             modifiers_ &= ~KeyboardModifier::Ctrl;  // ctrl key
-        if(arg.key == OIS::KC_RSHIFT   || arg.key == OIS::KC_LSHIFT)
+        if (arg.key == OIS::KC_RSHIFT   || arg.key == OIS::KC_LSHIFT)
             modifiers_ &= ~KeyboardModifier::Shift; // shift key
 
         KeyEvent evt(arg);




More information about the Orxonox-commit mailing list