[Orxonox-commit 2021] r6738 - code/branches/gamestates2/src/libraries/core/input

rgrieder at orxonox.net rgrieder at orxonox.net
Fri Apr 16 12:22:53 CEST 2010


Author: rgrieder
Date: 2010-04-16 12:22:52 +0200 (Fri, 16 Apr 2010)
New Revision: 6738

Modified:
   code/branches/gamestates2/src/libraries/core/input/InputManager.cc
Log:
Cosmetic changes in InputManager.

Modified: code/branches/gamestates2/src/libraries/core/input/InputManager.cc
===================================================================
--- code/branches/gamestates2/src/libraries/core/input/InputManager.cc	2010-04-16 10:22:12 UTC (rev 6737)
+++ code/branches/gamestates2/src/libraries/core/input/InputManager.cc	2010-04-16 10:22:52 UTC (rev 6738)
@@ -389,7 +389,7 @@
             if (device != NULL)
                 device->update(time);
 
-        // Collect functions calls for the update
+        // Collect function calls for the update
         for (unsigned int i = 0; i < activeStatesTicked_.size(); ++i)
             activeStatesTicked_[i]->update(time.getDeltaTime());
 
@@ -413,7 +413,8 @@
     */
     void InputManager::updateActiveStates()
     {
-        // temporary resize
+        // Calculate the stack of input states
+        // and assign it to the corresponding device
         for (unsigned int i = 0; i < devices_.size(); ++i)
         {
             if (devices_[i] == NULL)
@@ -432,15 +433,15 @@
             }
         }
 
-        // update tickables (every state will only appear once)
-        // Using a std::set to avoid duplicates
+        // See that we only update each InputState once for each device
+        // Using an std::set to avoid duplicates
         std::set<InputState*> tempSet;
         for (unsigned int i = 0; i < devices_.size(); ++i)
             if (devices_[i] != NULL)
                 for (unsigned int iState = 0; iState < devices_[i]->getStateListRef().size(); ++iState)
                     tempSet.insert(devices_[i]->getStateListRef()[iState]);
 
-        // copy the content of the std::set back to the actual vector
+        // Copy the content of the std::set back to the actual vector
         activeStatesTicked_.clear();
         for (std::set<InputState*>::const_iterator it = tempSet.begin();it != tempSet.end(); ++it)
             activeStatesTicked_.push_back(*it);




More information about the Orxonox-commit mailing list