[Orxonox-commit 105] r2800 - in branches/gui/src: core core/input network orxonox/gamestates orxonox/gui orxonox/overlays/console

rgrieder at orxonox.net rgrieder at orxonox.net
Thu Mar 19 10:34:55 CET 2009


Author: rgrieder
Date: 2009-03-19 09:34:54 +0000 (Thu, 19 Mar 2009)
New Revision: 2800

Modified:
   branches/gui/src/core/Core.cc
   branches/gui/src/core/Core.h
   branches/gui/src/core/TclThreadManager.cc
   branches/gui/src/core/TclThreadManager.h
   branches/gui/src/core/input/CalibratorCallback.h
   branches/gui/src/core/input/ExtendedInputState.cc
   branches/gui/src/core/input/ExtendedInputState.h
   branches/gui/src/core/input/InputBuffer.cc
   branches/gui/src/core/input/InputBuffer.h
   branches/gui/src/core/input/InputInterfaces.h
   branches/gui/src/core/input/InputManager.cc
   branches/gui/src/core/input/InputManager.h
   branches/gui/src/core/input/InputState.h
   branches/gui/src/core/input/KeyBinder.cc
   branches/gui/src/core/input/KeyBinder.h
   branches/gui/src/core/input/SimpleInputState.h
   branches/gui/src/network/Client.cc
   branches/gui/src/network/Client.h
   branches/gui/src/network/Server.cc
   branches/gui/src/network/Server.h
   branches/gui/src/orxonox/gamestates/GSClient.cc
   branches/gui/src/orxonox/gamestates/GSDedicated.cc
   branches/gui/src/orxonox/gamestates/GSGUI.cc
   branches/gui/src/orxonox/gamestates/GSGraphics.cc
   branches/gui/src/orxonox/gamestates/GSRoot.cc
   branches/gui/src/orxonox/gamestates/GSServer.cc
   branches/gui/src/orxonox/gamestates/GSStandalone.cc
   branches/gui/src/orxonox/gui/GUIManager.h
   branches/gui/src/orxonox/overlays/console/InGameConsole.cc
   branches/gui/src/orxonox/overlays/console/InGameConsole.h
Log:
Renaming "tick" to "update" for all those classes not inheriting from Tickable to avoid confusions.
GameState::ticked still exists, but that's going to change anyway.

Modified: branches/gui/src/core/Core.cc
===================================================================
--- branches/gui/src/core/Core.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/Core.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -562,8 +562,8 @@
         }
     }
 
-    void Core::tick(const Clock& time)
+    void Core::update(const Clock& time)
     {
-        this->tclThreadManager_->tick(time.getDeltaTime());
+        this->tclThreadManager_->update(time);
     }
 }

Modified: branches/gui/src/core/Core.h
===================================================================
--- branches/gui/src/core/Core.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/Core.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -65,7 +65,7 @@
             void setConfigValues();
 
             bool isLoaded() { return this->loaded_; }
-            void tick(const Clock& time);
+            void update(const Clock& time);
 
             static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; }
 

Modified: branches/gui/src/core/TclThreadManager.cc
===================================================================
--- branches/gui/src/core/TclThreadManager.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/TclThreadManager.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -34,6 +34,7 @@
 #include <boost/bind.hpp>
 #include <OgreTimer.h>
 
+#include "Clock.h"
 #include "CoreIncludes.h"
 #include "ConsoleCommand.h"
 #include "CommandExecutor.h"
@@ -597,7 +598,7 @@
         return output;
     }
 
-    void TclThreadManager::tick(float dt)
+    void TclThreadManager::update(const Clock& time)
     {
         {
             this->orxonoxEvalCondition_.notify_one();
@@ -632,7 +633,7 @@
 #else
             boost::try_mutex::scoped_lock interpreter_lock(this->orxonoxInterpreterBundle_.interpreterMutex_);
 #endif
-            unsigned long maxtime = (unsigned long)(dt * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE);
+            unsigned long maxtime = (unsigned long)(time.getDeltaTime() * 1000000 * TCLTHREADMANAGER_MAX_CPU_USAGE);
             Ogre::Timer timer;
             while (!this->queueIsEmpty())
             {

Modified: branches/gui/src/core/TclThreadManager.h
===================================================================
--- branches/gui/src/core/TclThreadManager.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/TclThreadManager.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -89,7 +89,7 @@
             void error(const std::string& error);
             void debug(const std::string& error);
 
-            virtual void tick(float dt);
+            void update(const Clock& time);
 
             std::list<unsigned int> getThreadList() const;
 

Modified: branches/gui/src/core/input/CalibratorCallback.h
===================================================================
--- branches/gui/src/core/input/CalibratorCallback.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/CalibratorCallback.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -51,7 +51,7 @@
         void keyReleased(const KeyEvent& evt) { }
         void keyHeld    (const KeyEvent& evt) { }
 
-        void tickInput(float dt) { }
+        void updateInput(float dt) { }
     };
 }
 

Modified: branches/gui/src/core/input/ExtendedInputState.cc
===================================================================
--- branches/gui/src/core/input/ExtendedInputState.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/ExtendedInputState.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -401,31 +401,31 @@
         return success;
     }
 
-    void ExtendedInputState::tickInput(float dt)
+    void ExtendedInputState::updateInput(float dt)
     {
         for (unsigned int i = 0; i < allHandlers_.size(); ++i)
         {
-            allHandlers_[i]->tickInput(dt);
+            allHandlers_[i]->updateInput(dt);
         }
     }
 
-    void ExtendedInputState::tickInput(float dt, unsigned int device)
+    void ExtendedInputState::updateInput(float dt, unsigned int device)
     {
         switch (device)
         {
         case Keyboard:
             for (unsigned int i = 0; i < keyHandlers_.size(); ++i)
-                keyHandlers_[i]->tickKey(dt);
+                keyHandlers_[i]->updateKey(dt);
             break;
 
         case Mouse:
             for (unsigned int i = 0; i < mouseHandlers_.size(); ++i)
-                mouseHandlers_[i]->tickMouse(dt);
+                mouseHandlers_[i]->updateMouse(dt);
             break;
 
         default: // joy sticks
             for (unsigned int i = 0; i < joyStickHandlers_[device - 2].size(); ++i)
-                joyStickHandlers_[device - 2][i]->tickJoyStick(dt, device - 2);
+                joyStickHandlers_[device - 2][i]->updateJoyStick(dt, device - 2);
             break;
         }
     }

Modified: branches/gui/src/core/input/ExtendedInputState.h
===================================================================
--- branches/gui/src/core/input/ExtendedInputState.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/ExtendedInputState.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -67,8 +67,8 @@
         ExtendedInputState() { }
         ~ExtendedInputState() { }
 
-        void tickInput(float dt);
-        void tickInput(float dt, unsigned int device);
+        void updateInput(float dt);
+        void updateInput(float dt, unsigned int device);
 
         void keyPressed (const KeyEvent& evt);
         void keyReleased(const KeyEvent& evt);

Modified: branches/gui/src/core/input/InputBuffer.cc
===================================================================
--- branches/gui/src/core/input/InputBuffer.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/InputBuffer.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -223,10 +223,10 @@
     }
 
     /**
-        @brief This tick() function is called by the InputManager if the InputBuffer is active.
+        @brief This update() function is called by the InputManager if the InputBuffer is active.
         @param dt Delta time
     */
-    void InputBuffer::tickInput(float dt)
+    void InputBuffer::updateInput(float dt)
     {
         timeSinceKeyPressed_ += dt;
         if (keysToRepeat_ < 10 && timeSinceKeyPressed_ > keyRepeatDeleay_)

Modified: branches/gui/src/core/input/InputBuffer.h
===================================================================
--- branches/gui/src/core/input/InputBuffer.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/InputBuffer.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -170,8 +170,8 @@
             void keyHeld    (const KeyEvent& evt);
             void processKey (const KeyEvent &e);
 
-            void tickInput(float dt);
-            void tickKey(float dt) { }
+            void updateInput(float dt);
+            void updateKey(float dt) { }
 
             std::string buffer_;
             std::list<BaseInputBufferListenerTuple*> listeners_;

Modified: branches/gui/src/core/input/InputInterfaces.h
===================================================================
--- branches/gui/src/core/input/InputInterfaces.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/InputInterfaces.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -473,7 +473,7 @@
     {
     public:
         virtual ~InputHandler() { }
-        virtual void tickInput(float dt) = 0;
+        virtual void updateInput(float dt) = 0;
     };
 
     /**
@@ -487,7 +487,7 @@
         virtual void keyPressed (const KeyEvent& evt) = 0;
         virtual void keyReleased(const KeyEvent& evt) = 0;
         virtual void keyHeld    (const KeyEvent& evt) = 0;
-        virtual void tickKey    (float dt) = 0;
+        virtual void updateKey    (float dt) = 0;
     };
 
     /**
@@ -503,7 +503,7 @@
         virtual void mouseButtonHeld    (MouseButtonCode::ByEnum id) = 0;
         virtual void mouseMoved         (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) = 0;
         virtual void mouseScrolled      (int abs, int rel)     = 0;
-        virtual void tickMouse          (float dt) = 0;
+        virtual void updateMouse          (float dt) = 0;
     };
 
 
@@ -519,7 +519,7 @@
         virtual void joyStickButtonReleased(unsigned int joyStickID, JoyStickButtonCode::ByEnum id) = 0;
         virtual void joyStickButtonHeld    (unsigned int joyStickID, JoyStickButtonCode::ByEnum id) = 0;
         virtual void joyStickAxisMoved     (unsigned int joyStickID, unsigned int axis, float value) = 0;
-        virtual void tickJoyStick          (float dt, unsigned int joyStick) = 0;
+        virtual void updateJoyStick          (float dt, unsigned int joyStick) = 0;
     };
 
     class _CoreExport EmptyHandler : public KeyHandler, public MouseHandler, public JoyStickHandler
@@ -530,10 +530,10 @@
         EmptyHandler(EmptyHandler&);
         virtual ~EmptyHandler() { }
 
-        void tickInput(float dt) { }
-        void tickJoyStick(float dt, unsigned int joyStick) { }
-        void tickMouse(float dt) { }
-        void tickKey(float dt) { }
+        void updateInput(float dt) { }
+        void updateJoyStick(float dt, unsigned int joyStick) { }
+        void updateMouse(float dt) { }
+        void updateKey(float dt) { }
 
         void keyPressed (const KeyEvent& evt) { }
         void keyReleased(const KeyEvent& evt) { }

Modified: branches/gui/src/core/input/InputManager.cc
===================================================================
--- branches/gui/src/core/input/InputManager.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/InputManager.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -42,6 +42,7 @@
 #include "ois/OISInputManager.h"
 
 #include "util/Exception.h"
+#include "core/Clock.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/CommandExecutor.h"
@@ -669,7 +670,7 @@
     /**
     @brief
         Public interface. Only reloads immediately if the call stack doesn't
-        include the tick() method.
+        include the update() method.
     @param joyStickSupport
         Whether or not to initialise joy sticks as well.
     */
@@ -741,10 +742,10 @@
     /**
     @brief
         Updates the states and the InputState situation.
-    @param dt
-        Delta time
+    @param time
+        Clock holding the current time.
     */
-    void InputManager::tick(float dt)
+    void InputManager::update(const Clock& time)
     {
         if (internalState_ == Uninitialised)
             return;
@@ -848,18 +849,18 @@
                     stateMaster_->joyStickButtonHeld(iJoyStick, joyStickButtonsDown_[iJoyStick][iButton]);
                 }
 
-            // tick the handlers for each active handler
+            // update the handlers for each active handler
             for (unsigned int i = 0; i < devicesNum_; ++i)
             {
-                activeStatesTop_[i]->tickInput(dt, i);
+                activeStatesTop_[i]->updateInput(time.getDeltaTime(), i);
                 if (stateMaster_->isInputDeviceEnabled(i))
-                    stateMaster_->tickInput(dt, i);
+                    stateMaster_->updateInput(time.getDeltaTime(), i);
             }
 
-            // tick the handler with a general tick afterwards
+            // update the handler with a general tick afterwards
             for (unsigned int i = 0; i < activeStatesTicked_.size(); ++i)
-                activeStatesTicked_[i]->tickInput(dt);
-            stateMaster_->tickInput(dt);
+                activeStatesTicked_[i]->updateInput(time.getDeltaTime());
+            stateMaster_->updateInput(time.getDeltaTime());
         }
 
         internalState_ &= ~Ticking;
@@ -868,7 +869,7 @@
     /**
     @brief
         Updates the currently active states (according to activeStates_) for each device.
-        Also, a list of all active states (no duplicates!) is compiled for the general tick.
+        Also, a list of all active states (no duplicates!) is compiled for the general update().
     */
     void InputManager::_updateActiveStates()
     {
@@ -1289,7 +1290,7 @@
         True if removal was successful, false if name was not found.
     @remarks
         You can't remove the internal states "empty", "calibrator" and "detector".
-        The removal process is being postponed if InputManager::tick() is currently running.
+        The removal process is being postponed if InputManager::update() is currently running.
     */
     bool InputManager::requestDestroyState(const std::string& name)
     {

Modified: branches/gui/src/core/input/InputManager.h
===================================================================
--- branches/gui/src/core/input/InputManager.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/InputManager.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -124,7 +124,7 @@
         bool requestEnterState     (const std::string& name);
         bool requestLeaveState     (const std::string& name);
 
-        void tick(float dt);
+        void update(const Clock& time);
 
         static InputManager& getInstance()    { assert(singletonRef_s); return *singletonRef_s; }
         static InputManager* getInstancePtr() { return singletonRef_s; }

Modified: branches/gui/src/core/input/InputState.h
===================================================================
--- branches/gui/src/core/input/InputState.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/InputState.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -70,8 +70,8 @@
         virtual void registerOnLeave(Executor* executor)      { executorOnLeave_ = executor; }
         virtual void unRegisterOnLeave()                      { executorOnLeave_ = 0; }
 
-        virtual void tickInput(float dt, unsigned int device) = 0;
-        virtual void tickInput(float dt) = 0;
+        virtual void updateInput(float dt, unsigned int device) = 0;
+        virtual void updateInput(float dt) = 0;
 
         virtual void keyPressed (const KeyEvent& evt) = 0;
         virtual void keyReleased(const KeyEvent& evt) = 0;

Modified: branches/gui/src/core/input/KeyBinder.cc
===================================================================
--- branches/gui/src/core/input/KeyBinder.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/KeyBinder.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -308,7 +308,7 @@
         }
     }
 
-    void KeyBinder::tickMouse(float dt)
+    void KeyBinder::updateMouse(float dt)
     {
         if (bDeriveMouseInput_)
         {
@@ -348,7 +348,7 @@
         {
             // Why dividing relative value by dt? The reason lies in the simple fact, that when you
             // press a button that has relative movement, that value has to be multiplied by dt to be
-            // frame rate independent. This can easily (and only) be done in tickInput(float).
+            // frame rate independent. This can easily (and only) be done in updateInput(float).
             // Hence we need to divide by dt here for the mouse to compensate, because the relative
             // move movements have nothing to do with dt.
             if (dt != 0.0f)
@@ -361,7 +361,7 @@
         }
     }
 
-    void KeyBinder::tickJoyStick(float dt, unsigned int joyStick)
+    void KeyBinder::updateJoyStick(float dt, unsigned int joyStick)
     {
         for (unsigned int i = 0; i < JoyStickAxisCode::numberOfAxes * 2; i++)
         {

Modified: branches/gui/src/core/input/KeyBinder.h
===================================================================
--- branches/gui/src/core/input/KeyBinder.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/KeyBinder.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -67,10 +67,10 @@
         void resetJoyStickAxes();
 
     protected: // functions
-        void tickInput(float dt);
-        void tickKey(float dt) { }
-        void tickMouse(float dt);
-        void tickJoyStick(float dt, unsigned int joyStick);
+        void updateInput(float dt);
+        void updateKey(float dt) { }
+        void updateMouse(float dt);
+        void updateJoyStick(float dt, unsigned int joyStick);
         // internal
         void tickHalfAxis(HalfAxis& halfAxis);
 
@@ -133,7 +133,7 @@
         /**
         @brief
             Commands that have additional parameters (axes) are executed at the end of
-            the tick() so that all values can be buffered for single execution.
+            update() so that all values can be buffered for single execution.
         */
         std::vector<BufferedParamCommand*> paramCommandBuffer_;
 
@@ -199,7 +199,7 @@
     inline void KeyBinder::joyStickButtonHeld    (unsigned int joyStickID, JoyStickButtonCode::ByEnum id)
     { joyStickButtons_[joyStickID][id].execute(KeybindMode::OnHold); }
 
-    inline void KeyBinder::tickInput(float dt)
+    inline void KeyBinder::updateInput(float dt)
     {
         // execute all buffered bindings (additional parameter)
         for (unsigned int i = 0; i < paramCommandBuffer_.size(); i++)

Modified: branches/gui/src/core/input/SimpleInputState.h
===================================================================
--- branches/gui/src/core/input/SimpleInputState.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/core/input/SimpleInputState.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -58,8 +58,8 @@
         SimpleInputState();
         ~SimpleInputState() { }
 
-        void tickInput(float dt);
-        void tickInput(float dt, unsigned int device);
+        void updateInput(float dt);
+        void updateInput(float dt, unsigned int device);
 
         void keyPressed (const KeyEvent& evt);
         void keyReleased(const KeyEvent& evt);
@@ -86,31 +86,31 @@
         std::vector<InputHandler*>    allHandlers_;
     };
 
-    inline void SimpleInputState::tickInput(float dt)
+    inline void SimpleInputState::updateInput(float dt)
     {
         for (unsigned int i = 0; i < allHandlers_.size(); ++i)
         {
-            allHandlers_[i]->tickInput(dt);
+            allHandlers_[i]->updateInput(dt);
         }
     }
 
-    inline void SimpleInputState::tickInput(float dt, unsigned int device)
+    inline void SimpleInputState::updateInput(float dt, unsigned int device)
     {
         switch (device)
         {
         case InputDevice::Keyboard:
             if (keyHandler_)
-                keyHandler_->tickKey(dt);
+                keyHandler_->updateKey(dt);
             break;
 
         case InputDevice::Mouse:
             if (mouseHandler_)
-                mouseHandler_->tickMouse(dt);
+                mouseHandler_->updateMouse(dt);
             break;
 
         default: // joy sticks
             if (joyStickHandler_[device - 2])
-                joyStickHandler_[device - 2]->tickJoyStick(dt, device - 2);
+                joyStickHandler_[device - 2]->updateJoyStick(dt, device - 2);
             break;
         }
     }

Modified: branches/gui/src/network/Client.cc
===================================================================
--- branches/gui/src/network/Client.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/network/Client.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -44,6 +44,7 @@
 #include "Client.h"
 #include "Host.h"
 #include "synchronisable/Synchronisable.h"
+#include "core/Clock.h"
 #include "core/CoreIncludes.h"
 #include "packet/Packet.h"
 
@@ -137,7 +138,7 @@
    * Processes incoming packets, sends a gamestate to the server and does the cleanup
    * @param time
    */
-  void Client::tick(float time){
+  void Client::update(const Clock& time){
 //     COUT(3) << ".";
     if(client_connection.isConnected() && isSynched_){
       COUT(4) << "popping partial gamestate: " << std::endl;

Modified: branches/gui/src/network/Client.h
===================================================================
--- branches/gui/src/network/Client.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/network/Client.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -75,7 +75,7 @@
     virtual bool broadcast(const std::string& message) { return false; }
     //bool sendChat(packet::Chat *chat);
 
-    void tick(float time);
+    void update(const Clock& time);
 
   private:
     Client(const Client& copy); // not used

Modified: branches/gui/src/network/Server.cc
===================================================================
--- branches/gui/src/network/Server.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/network/Server.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -50,6 +50,7 @@
 #include "GamestateManager.h"
 #include "ClientInformation.h"
 #include "util/Sleep.h"
+#include "core/Clock.h"
 #include "core/ConsoleCommand.h"
 #include "core/CoreIncludes.h"
 #include "core/Iterator.h"
@@ -148,10 +149,10 @@
   * calls processQueue and updateGamestate
   * @param time time since last tick
   */
-  void Server::tick(float time) {
+  void Server::update(const Clock& time) {
     processQueue();
     //this steers our network frequency
-    timeSinceLastUpdate_+=time;
+    timeSinceLastUpdate_+=time.getDeltaTime();
     if(timeSinceLastUpdate_>=NETWORK_PERIOD){
       timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
       gamestates_->processGamestates();

Modified: branches/gui/src/network/Server.h
===================================================================
--- branches/gui/src/network/Server.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/network/Server.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -70,7 +70,7 @@
     void close();
     bool processChat(const std::string& message, unsigned int playerID);
     bool queuePacket(ENetPacket *packet, int clientID);
-    void tick(float time);
+    void update(const Clock& time);
     unsigned int getPing(unsigned int clientID);
     double getPacketLoss(unsigned int clientID);
   protected:

Modified: branches/gui/src/orxonox/gamestates/GSClient.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSClient.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSClient.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -30,6 +30,7 @@
 #include "GSClient.h"
 
 #include "core/input/InputManager.h"
+#include "core/Clock.h"
 #include "core/CommandLine.h"
 #include "core/Core.h"
 #include "network/Client.h"
@@ -59,7 +60,8 @@
 
         GSLevel::enter(this->getParent()->getViewport());
 
-        client_->tick(0);
+        // TODO: Get Clock from Game or GameStateManager, but with 0 delta time
+        client_->update(Clock());
     }
 
     void GSClient::leave()
@@ -77,7 +79,7 @@
     void GSClient::ticked(const Clock& time)
     {
         GSLevel::ticked(time);
-        client_->tick(time.getDeltaTime());
+        client_->update(time);
 
         this->tickChild(time);
     }

Modified: branches/gui/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSDedicated.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSDedicated.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -29,6 +29,7 @@
 #include "OrxonoxStableHeaders.h"
 #include "GSDedicated.h"
 
+#include "core/Clock.h"
 #include "core/CommandLine.h"
 #include "core/Core.h"
 #include "core/Iterator.h"
@@ -82,7 +83,7 @@
 //            COUT(0) << "estimated ticks/sec: " << nrOfTicks/(time.getSecondsPrecise()-startTime) << endl;
             timeSinceLastUpdate_ -= static_cast<unsigned int>(timeSinceLastUpdate_ / NETWORK_PERIOD) * NETWORK_PERIOD;
             GSLevel::ticked(time);
-            server_->tick(time.getDeltaTime());
+            server_->update(time);
             this->tickChild(time);
         }
         else

Modified: branches/gui/src/orxonox/gamestates/GSGUI.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSGUI.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSGUI.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -30,6 +30,7 @@
 #include "GSGUI.h"
 
 #include <OgreViewport.h>
+#include "core/Clock.h"
 #include "core/input/InputManager.h"
 #include "core/input/SimpleInputState.h"
 #include "gui/GUIManager.h"
@@ -63,7 +64,7 @@
     void GSGUI::ticked(const Clock& time)
     {
         // tick CEGUI
-        guiManager_->tick(time.getDeltaTime());
+        guiManager_->update(time);
 
         this->tickChild(time);
     }

Modified: branches/gui/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSGraphics.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSGraphics.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -232,9 +232,9 @@
 
         float dt = time.getDeltaTime();
 
-        this->inputManager_->tick(dt);
+        this->inputManager_->update(time);
         // tick console
-        this->console_->tick(dt);
+        this->console_->update(time);
         this->tickChild(time);
 
         if (this->bWindowEventListenerUpdateRequired_)

Modified: branches/gui/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSRoot.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSRoot.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -133,7 +133,7 @@
     {
         uint64_t timeBeforeTick = time.getRealMicroseconds();
 
-        Core::getInstance().tick(time);
+        Core::getInstance().update(time);
 
         for (ObjectList<TimerBase>::iterator it = ObjectList<TimerBase>::begin(); it; ++it)
             it->tick(time);

Modified: branches/gui/src/orxonox/gamestates/GSServer.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSServer.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSServer.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -72,7 +72,7 @@
     void GSServer::ticked(const Clock& time)
     {
         GSLevel::ticked(time);
-        server_->tick(time.getDeltaTime());
+        server_->update(time);
         this->tickChild(time);
     }
 }

Modified: branches/gui/src/orxonox/gamestates/GSStandalone.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSStandalone.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gamestates/GSStandalone.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -85,7 +85,7 @@
                 guiManager_->hideGUI();
         }
         // tick CEGUI
-        guiManager_->tick(time.getDeltaTime());
+        guiManager_->update(time);
 
         GSLevel::ticked(time);
         this->tickChild(time);

Modified: branches/gui/src/orxonox/gui/GUIManager.h
===================================================================
--- branches/gui/src/orxonox/gui/GUIManager.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/gui/GUIManager.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -39,6 +39,7 @@
 #include <CEGUIForwardRefs.h>
 #include <CEGUIInputEvent.h>
 #include <CEGUISystem.h>
+#include "core/Clock.h"
 #include "core/input/InputInterfaces.h"
 
 // Forward declaration
@@ -70,10 +71,10 @@
 
         bool initialise(Ogre::RenderWindow* renderWindow);
         void loadScene(const std::string& name);
-        void tick(float dt)
+        void update(const Clock& time)
         {
             assert(guiSystem_);
-            guiSystem_->injectTimePulse(dt);
+            guiSystem_->injectTimePulse(time.getDeltaTime());
         }
         void showGUI(const std::string& name, Ogre::SceneManager* sceneManager);// bool showBackground); // tolua_export
         void hideGUI(); // tolua_export
@@ -107,9 +108,9 @@
         void mouseScrolled      (int abs, int rel)
         { guiSystem_->injectMouseWheelChange(rel);}
 
-        void tickInput(float dt) { }
-        void tickKey(float dt) { }
-        void tickMouse(float dt) { }
+        void updateInput(float dt) { }
+        void updateKey(float dt) { }
+        void updateMouse(float dt) { }
 
         void loadScenes();
 

Modified: branches/gui/src/orxonox/overlays/console/InGameConsole.cc
===================================================================
--- branches/gui/src/orxonox/overlays/console/InGameConsole.cc	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/overlays/console/InGameConsole.cc	2009-03-19 09:34:54 UTC (rev 2800)
@@ -41,6 +41,7 @@
 #include "util/Math.h"
 #include "util/Convert.h"
 #include "util/Debug.h"
+#include "core/Clock.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
 #include "core/ConsoleCommand.h"
@@ -346,7 +347,7 @@
     /**
         @brief Used to control the actual scrolling and the cursor.
     */
-    void InGameConsole::tick(float dt)
+    void InGameConsole::update(const Clock& time)
     {
         if (this->scroll_ != 0)
         {
@@ -357,7 +358,7 @@
                 // scrolling down
                 // enlarge oldTop a little bit so that this exponential function
                 // reaches 0 before infinite time has passed...
-                float deltaScroll = (oldTop - 0.01) * dt * this->scrollSpeed_;
+                float deltaScroll = (oldTop - 0.01) * time.getDeltaTime() * this->scrollSpeed_;
                 if (oldTop - deltaScroll >= 0)
                 {
                     // window has completely scrolled down
@@ -372,7 +373,7 @@
             {
                 // scrolling up
                 // note: +0.01 for the same reason as when scrolling down
-                float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * dt * this->scrollSpeed_;
+                float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * time.getDeltaTime() * this->scrollSpeed_;
                 if (oldTop - deltaScroll <= -1.2 * this->relativeHeight)
                 {
                     // window has completely scrolled up
@@ -387,7 +388,7 @@
 
         if (this->bActive_)
         {
-            this->cursor_ += dt;
+            this->cursor_ += time.getDeltaTime();
             if (this->cursor_ >= this->blinkTime)
             {
                 this->cursor_ = 0;

Modified: branches/gui/src/orxonox/overlays/console/InGameConsole.h
===================================================================
--- branches/gui/src/orxonox/overlays/console/InGameConsole.h	2009-03-18 20:15:39 UTC (rev 2799)
+++ branches/gui/src/orxonox/overlays/console/InGameConsole.h	2009-03-19 09:34:54 UTC (rev 2800)
@@ -52,7 +52,7 @@
         void destroy();
         void setConfigValues();
 
-        virtual void tick(float dt);
+        void update(const Clock& time);
 
         static InGameConsole& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
         static InGameConsole* getInstancePtr() { return singletonRef_s; }




More information about the Orxonox-commit mailing list