Index: code/branches/gui/src/core/Clock.cc
===================================================================
--- code/branches/gui/src/core/Clock.cc	(revision 1674)
+++ code/branches/gui/src/core/Clock.cc	(revision 1674)
@@ -0,0 +1,78 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief
+*/
+
+#include "Clock.h"
+#include <OgreTimer.h>
+
+namespace orxonox
+{
+    Clock::Clock()
+        : timer_(new Ogre::Timer())
+        , storedTime_(0)
+        , tickTime_(0)
+        , tickDt_(0)
+        , tickDtFloat_(0.0f)
+        , lastTimersTime_(0)
+    {
+    }
+
+    Clock::~Clock()
+    {
+        delete timer_;
+    }
+    
+    void Clock::capture()
+    {
+        unsigned long timersTime = timer_->getMicroseconds();
+        tickTime_ = storedTime_ + timersTime;
+        tickDt_ = timersTime - lastTimersTime_;
+        tickDtFloat_ = (float)tickDt_ / 1000000.0f;
+
+        if (timersTime > 0x7FFFFFF0)
+        {
+            // Ogre timer will overflow at 2^32 microseconds if unsigned long is 32 bit
+            storedTime_ += timersTime;
+            lastTimersTime_ = 0;
+            timer_->reset();
+        }
+        else
+        {
+            lastTimersTime_ = timersTime;
+        }
+    }
+
+    uint64_t Clock::getRealMicroseconds() const
+    {
+        return this->timer_->getMicroseconds();
+    }
+}
Index: code/branches/gui/src/core/Clock.h
===================================================================
--- code/branches/gui/src/core/Clock.h	(revision 1674)
+++ code/branches/gui/src/core/Clock.h	(revision 1674)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      Reto Grieder
+ *
+ */
+
+/**
+    @file Core.h
+    @brief Declaration of the Core class.
+
+    The Core class is a singleton, only used to configure some variables
+    in the core through the config-file.
+*/
+
+#ifndef _Clock_H__
+#define _Clock_H__
+
+#include "CorePrereqs.h"
+#include <OgrePrerequisites.h>
+#include "util/Integers.h"
+
+namespace orxonox
+{
+    class _CoreExport Clock
+    {
+        friend RootGameState;
+
+    public:
+        Clock();
+        ~Clock();
+
+        uint64_t getMicroseconds()   const { return tickTime_; }
+        uint64_t getMilliseconds()   const { return tickTime_ / 1000; }
+        int      getSeconds()        const { return tickTime_ / 1000000; }
+        float    getSecondsPrecise() const { return (float)tickTime_ / 1000000.0f; }
+
+        float    getDeltaTime()      const { return tickDtFloat_; }
+        int      getDeltaTimeMicroseconds() const { return tickDt_; }
+
+        uint64_t getRealMicroseconds() const;
+
+    private:
+        Clock(const Clock& instance);
+        void capture();
+
+        Ogre::Timer*  timer_;
+        uint64_t      storedTime_;
+        uint64_t      tickTime_;
+        int           tickDt_;
+        float         tickDtFloat_;
+        unsigned long lastTimersTime_;
+    };
+}
+
+#endif /* _Clock_H__ */
Index: code/branches/gui/src/core/CorePrereqs.h
===================================================================
--- code/branches/gui/src/core/CorePrereqs.h	(revision 1673)
+++ code/branches/gui/src/core/CorePrereqs.h	(revision 1674)
@@ -162,5 +162,4 @@
 
   // game states
-  class BaseGameState;
   class GameState;
   class RootGameState;
Index: code/branches/gui/src/core/GameState.cc
===================================================================
--- code/branches/gui/src/core/GameState.cc	(revision 1673)
+++ code/branches/gui/src/core/GameState.cc	(revision 1674)
@@ -34,5 +34,4 @@
 
 #include "GameState.h"
-#include <cassert>
 #include "Debug.h"
 #include "Exception.h"
@@ -359,8 +358,8 @@
         This method is not virtual! You cannot override it therefore.
     */
-    void GameState::tick(float dt, uint64_t time)
+    void GameState::tick(const Clock& time)
     {
         this->operation_.running = true;
-        this->ticked(dt, time);
+        this->ticked(time);
         this->operation_.running = false;
     }
Index: code/branches/gui/src/core/GameState.h
===================================================================
--- code/branches/gui/src/core/GameState.h	(revision 1673)
+++ code/branches/gui/src/core/GameState.h	(revision 1674)
@@ -42,4 +42,5 @@
 #include <map>
 #include "util/Integers.h"
+#include "Clock.h"
 
 namespace orxonox
@@ -100,9 +101,9 @@
         virtual void enter() = 0;
         virtual void leave() = 0;
-        virtual void ticked(float dt, uint64_t time) = 0;
+        virtual void ticked(const Clock& time) = 0;
 
         GameState* getActiveChild() { return this->activeChild_; }
 
-        void tickChild(float dt, uint64_t time) { if (this->getActiveChild()) this->getActiveChild()->tick(dt, time); }
+        void tickChild(const Clock& time) { if (this->getActiveChild()) this->getActiveChild()->tick(time); }
 
     private:
@@ -113,5 +114,5 @@
         void grandchildRemoved(GameState* grandchild);
 
-        void tick(float dt, uint64_t time);
+        void tick(const Clock& time);
         void activate();
         void deactivate();
Index: code/branches/gui/src/core/RootGameState.cc
===================================================================
--- code/branches/gui/src/core/RootGameState.cc	(revision 1673)
+++ code/branches/gui/src/core/RootGameState.cc	(revision 1674)
@@ -29,6 +29,5 @@
 #include "RootGameState.h"
 
-#include <OgreTimer.h>
-#include "util/Integers.h"
+#include "Clock.h"
 #include "Debug.h"
 #include "Exception.h"
@@ -95,8 +94,4 @@
             if (current)
             {
-                //OrxAssert(dynamic_cast<GameState*>(current),
-                //    "RootGameState: There was a RootGameState in the subtree of Root");
-                //GameState* currentGS = static_cast<GameState*>(current);
-                //currentGS->makeTransition(this, request);
                 current->makeTransition(0, request);
             }
@@ -141,27 +136,10 @@
         gotoState(initialState);
 
-        Ogre::Timer timer;
-        uint64_t storedTime = 0;
-        unsigned long lastTimersTime = 1;
-        timer.reset();
+        Clock clock;
         while (this->activeChild_)
         {
-            // get current time
-            unsigned long timersTime = timer.getMicroseconds();
-            uint64_t realTime = storedTime + timersTime;
-            float dt = (float)(timersTime - lastTimersTime)/1000000.0f;
-            if (timersTime > 7000000)
-            {
-                // Under worst condition, the ogre timer will overflow right after 7 seconds
-                storedTime += timersTime;
-                lastTimersTime = 0;
-                timer.reset();
-            }
-            else
-            {
-                lastTimersTime = timersTime;
-            }
+            clock.capture();
 
-            this->tick(dt, realTime);
+            this->tick(clock);
 
             if (this->stateRequest_ != "")
Index: code/branches/gui/src/core/RootGameState.h
===================================================================
--- code/branches/gui/src/core/RootGameState.h	(revision 1673)
+++ code/branches/gui/src/core/RootGameState.h	(revision 1674)
@@ -31,5 +31,4 @@
 
 #include "CorePrereqs.h"
-#include <OgrePrerequisites.h>
 #include "GameState.h"
 
@@ -38,6 +37,4 @@
     class _CoreExport RootGameState : public GameState
     {
-        //friend class GameState;
-
     public:
         RootGameState(const std::string& name);
@@ -46,9 +43,4 @@
         void requestState(const std::string& name);
         void start();
-
-    protected:
-        //virtual void ticked(float dt) = 0;
-        //virtual void enter() = 0;
-        //virtual void leave() = 0;
 
     private:
