Revision: 2726
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2726&view=rev
Author:   ulteq
Date:     2012-05-27 09:16:59 +0000 (Sun, 27 May 2012)
Log Message:
-----------
miniature fix, style++

Modified Paths:
--------------
    trunk/source/main/gui/GUIInputManager.cpp
    trunk/source/main/gui/GUIInputManager.h
    trunk/source/main/utils/InputEngine.cpp

Modified: trunk/source/main/gui/GUIInputManager.cpp
===================================================================
--- trunk/source/main/gui/GUIInputManager.cpp   2012-05-27 04:28:43 UTC (rev 
2725)
+++ trunk/source/main/gui/GUIInputManager.cpp   2012-05-27 09:16:59 UTC (rev 
2726)
@@ -18,7 +18,6 @@
 along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
 */
 #ifdef USE_MYGUI
-
 #include "GUIInputManager.h"
 
 #include "OverlayWrapper.h"
@@ -86,11 +85,11 @@
 #endif
 
 GUIInputManager::GUIInputManager() :
-       mCursorX(0),
-       mCursorY(0),
-       width(0),
-       height(0),
-       lastMouseMoveTime(0)
+         height(0)
+       , lastMouseMoveTime(0)
+       , mCursorX(0)
+       , mCursorY(0)
+       , width(0)
 {
        lastMouseMoveTime = new Ogre::Timer();
 }
@@ -99,7 +98,16 @@
 {
 }
 
+float GUIInputManager::getLastMouseMoveTime()
+{
+       if (lastMouseMoveTime)
+       {
+               return lastMouseMoveTime->getMilliseconds();
+       }
 
+       return 0.0f;
+}
+
 bool GUIInputManager::mouseMoved(const OIS::MouseEvent& _arg)
 {
        activateGUI();

Modified: trunk/source/main/gui/GUIInputManager.h
===================================================================
--- trunk/source/main/gui/GUIInputManager.h     2012-05-27 04:28:43 UTC (rev 
2725)
+++ trunk/source/main/gui/GUIInputManager.h     2012-05-27 09:16:59 UTC (rev 
2726)
@@ -39,7 +39,7 @@
 
     void setMousePosition(int _x, int _y);
 
-       float getLastMouseMoveTime() { return 
lastMouseMoveTime->getMilliseconds(); };
+       float getLastMouseMoveTime();
 
 protected:
 

Modified: trunk/source/main/utils/InputEngine.cpp
===================================================================
--- trunk/source/main/utils/InputEngine.cpp     2012-05-27 04:28:43 UTC (rev 
2725)
+++ trunk/source/main/utils/InputEngine.cpp     2012-05-27 09:16:59 UTC (rev 
2726)
@@ -1682,7 +1682,7 @@
                {
                        //This demo uses at most 10 joysticks - use old way to 
create (i.e. disregard vendor)
                        int numSticks = 
std::min(mInputManager->getNumberOfDevices(OISJoyStick), 10);
-                       free_joysticks=0;
+                       free_joysticks = 0;
                        for (int i = 0; i < numSticks; ++i)
                        {
                                mJoy[i] = 
(JoyStick*)mInputManager->createInputObject(OISJoyStick, true);
@@ -1858,11 +1858,23 @@
 
 void InputEngine::Capture()
 {
-       if (mKeyboard) mKeyboard->capture();
-       if (mMouse) mMouse->capture();
-       if (free_joysticks)
-               for (int i=0;i<free_joysticks;i++)
-                       if (mJoy[i]) mJoy[i]->capture();
+       if (mKeyboard)
+       {
+               mKeyboard->capture();
+       }
+
+       if (mMouse)
+       {
+               mMouse->capture();
+       }
+
+       for (int i=0; i < free_joysticks; i++)
+       {
+               if (mJoy[i])
+               {
+                       mJoy[i]->capture();
+               }
+       }
 }
 
 void InputEngine::windowResized()

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to