Index: code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc	(revision 2396)
+++ code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc	(revision 2400)
@@ -41,8 +41,6 @@
 #include "core/CoreIncludes.h"
 #include "core/Core.h"
-//#include "objects/Backlight.h"
 #include "objects/Tickable.h"
 #include "objects/Radar.h"
-//#include "tools/ParticleInterface.h"
 #include "CameraManager.h"
 #include "LevelManager.h"
@@ -56,6 +54,5 @@
     GSLevel::GSLevel()
 //        : GameState<GSGraphics>(name)
-        : timeFactor_(1.0f)
-        , keyBinder_(0)
+        : keyBinder_(0)
         , inputState_(0)
         , radar_(0)
@@ -68,5 +65,4 @@
         this->ccKeybind_ = 0;
         this->ccTkeybind_ = 0;
-        this->ccSetTimeFactor_ = 0;
 
         setConfigValues();
@@ -107,7 +103,4 @@
             // create the global LevelManager
             this->levelManager_ = new LevelManager();
-
-            // reset game speed to normal
-            timeFactor_ = 1.0f;
 
             this->loadLevel();
@@ -134,13 +127,4 @@
             InputManager::getInstance().requestEnterState("game");
         }
-
-        if (Core::isMaster())
-        {
-            // time factor console command
-            FunctorMember<GSLevel>* functor = createFunctor(&GSLevel::setTimeFactor);
-            functor->setObject(this);
-            ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor");
-            CommandExecutor::addConsoleCommandShortcut(ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);;
-        }
     }
 
@@ -152,9 +136,4 @@
             delete this->ccKeybind_;
             this->ccKeybind_ = 0;
-        }
-        if (this->ccSetTimeFactor_)
-        {
-            delete this->ccSetTimeFactor_;
-            this->ccSetTimeFactor_ = 0;
         }
         if (this->ccTkeybind_)
@@ -218,23 +197,4 @@
         //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
         //    it->tick(time.getDeltaTime() * this->timeFactor_);
-    }
-
-    /**
-    @brief
-        Changes the speed of Orxonox
-    */
-    void GSLevel::setTimeFactor(float factor)
-    {
-/*
-        float change = factor / this->timeFactor_;
-*/
-        this->timeFactor_ = factor;
-/*
-        for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it; ++it)
-            it->setSpeedFactor(it->getSpeedFactor() * change);
-
-        for (ObjectList<Backlight>::iterator it = ObjectList<Backlight>::begin(); it; ++it)
-            it->setTimeFactor(timeFactor_);
-*/
     }
 
Index: code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.h	(revision 2396)
+++ code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.h	(revision 2400)
@@ -44,9 +44,4 @@
         ~GSLevel();
 
-        // this has to be public because proteced triggers a bug in msvc
-        // when taking the function address.
-        void setTimeFactor(float factor);
-        float getTimeFactor() { return this->timeFactor_; }
-
     protected:
         void enter(Ogre::Viewport* viewport);
@@ -56,6 +51,4 @@
         void loadLevel();
         void unloadLevel();
-
-        float timeFactor_;       //!< A factor that sets the gamespeed. 1 is normal.
 
         // console commands
@@ -80,5 +73,4 @@
         ConsoleCommand*       ccKeybind_;
         ConsoleCommand*       ccTkeybind_;
-        ConsoleCommand*       ccSetTimeFactor_;
 
     private:
Index: code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.cc	(revision 2396)
+++ code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.cc	(revision 2400)
@@ -32,4 +32,5 @@
 #include "util/Exception.h"
 #include "util/Debug.h"
+#include "core/Core.h"
 #include "core/Factory.h"
 #include "core/ConfigValueIncludes.h"
@@ -43,4 +44,6 @@
 #include "tools/Timer.h"
 #include "objects/Tickable.h"
+#include "objects/worldentities/Backlight.h"
+#include "tools/ParticleInterface.h"
 #include "Settings.h"
 
@@ -67,4 +70,5 @@
     GSRoot::GSRoot()
         : RootGameState("root")
+        , timeFactor_(1.0f)
         , settings_(0)
         , tclBind_(0)
@@ -74,4 +78,6 @@
         RegisterRootObject(GSRoot);
         setConfigValues();
+
+        this->ccSetTimeFactor_ = 0;
     }
 
@@ -88,4 +94,7 @@
         // creates the class hierarchy for all classes with factories
         Factory::createClassHierarchy();
+
+        // reset game speed to normal
+        timeFactor_ = 1.0f;
 
         // Create the lua interface
@@ -129,4 +138,10 @@
         ccSelectGameState_ = createConsoleCommand(functor2, "selectGameState");
         CommandExecutor::addConsoleCommandShortcut(ccSelectGameState_);
+
+        // time factor console command
+        FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::setTimeFactor);
+        functor->setObject(this);
+        ccSetTimeFactor_ = createConsoleCommand(functor, "setTimeFactor");
+        CommandExecutor::addConsoleCommandShortcut(ccSetTimeFactor_).accessLevel(AccessLevel::Offline).defaultValue(0, 1.0);;
     }
 
@@ -143,4 +158,10 @@
         delete this->settings_;
         delete this->luaBind_;
+
+        if (this->ccSetTimeFactor_)
+        {
+            delete this->ccSetTimeFactor_;
+            this->ccSetTimeFactor_ = 0;
+        }
     }
 
@@ -155,5 +176,5 @@
         // Call the Tickable objects
         for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
-            it->tick(time.getDeltaTime());
+            it->tick(time.getDeltaTime() * this->timeFactor_);
         /*** HACK *** HACK ***/
 
@@ -168,5 +189,5 @@
 
         Copyright (c) 2000-2008 Torus Knot Software Ltd
-        
+
         OGRE is licensed under the LGPL. For more info, see OGRE license.
     */
@@ -175,16 +196,16 @@
 #if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
         // Get the current process core mask
-	    DWORD procMask;
-	    DWORD sysMask;
+        DWORD procMask;
+        DWORD sysMask;
 #  if _MSC_VER >= 1400 && defined (_M_X64)
-	    GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR)&procMask, (PDWORD_PTR)&sysMask);
+        GetProcessAffinityMask(GetCurrentProcess(), (PDWORD_PTR)&procMask, (PDWORD_PTR)&sysMask);
 #  else
-	    GetProcessAffinityMask(GetCurrentProcess(), &procMask, &sysMask);
-#  endif
-
-	    // If procMask is 0, consider there is only one core available
-	    // (using 0 as procMask will cause an infinite loop below)
-	    if (procMask == 0)
-		    procMask = 1;
+        GetProcessAffinityMask(GetCurrentProcess(), &procMask, &sysMask);
+#  endif
+
+        // If procMask is 0, consider there is only one core available
+        // (using 0 as procMask will cause an infinite loop below)
+        if (procMask == 0)
+            procMask = 1;
 
         // if the core specified with limitToCPU is not available, take the lowest one
@@ -192,12 +213,33 @@
             limitToCPU = 0;
 
-	    // Find the lowest core that this process uses and limitToCPU suggests
+        // Find the lowest core that this process uses and limitToCPU suggests
         DWORD threadMask = 1;
-	    while ((threadMask & procMask) == 0 || (threadMask < (1u << limitToCPU)))
-		    threadMask <<= 1;
-
-	    // Set affinity to the first core
-	    SetThreadAffinityMask(GetCurrentThread(), threadMask);
+        while ((threadMask & procMask) == 0 || (threadMask < (1u << limitToCPU)))
+            threadMask <<= 1;
+
+        // Set affinity to the first core
+        SetThreadAffinityMask(GetCurrentThread(), threadMask);
 #endif
     }
+
+    /**
+    @brief
+        Changes the speed of Orxonox
+    */
+    void GSRoot::setTimeFactor(float factor)
+    {
+        if (Core::isMaster())
+        {
+            float change = factor / this->timeFactor_;
+
+            this->timeFactor_ = factor;
+/*
+            for (ObjectList<ParticleInterface>::iterator it = ObjectList<ParticleInterface>::begin(); it != ObjectList<ParticleInterface>::end(); ++it)
+                it->setSpeedFactor(it->getSpeedFactor() * change);
+
+            for (ObjectList<Backlight>::iterator it = ObjectList<Backlight>::begin(); it != ObjectList<Backlight>::end(); ++it)
+                it->setTimeFactor(timeFactor_);
+*/
+        }
+    }
 }
Index: code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.h	(revision 2396)
+++ code/branches/objecthierarchy2/src/orxonox/gamestates/GSRoot.h	(revision 2400)
@@ -47,4 +47,9 @@
         { requestState("root"); }
 
+        // this has to be public because proteced triggers a bug in msvc
+        // when taking the function address.
+        void setTimeFactor(float factor);
+        float getTimeFactor() { return this->timeFactor_; }
+
     private:
         void enter();
@@ -55,4 +60,5 @@
         void setThreadAffinity(unsigned int limitToCPU);
 
+        float                 timeFactor_;       //!< A factor that sets the gamespeed. 1 is normal.
         Settings*             settings_;
         TclBind*              tclBind_;
@@ -64,4 +70,5 @@
         ConsoleCommand*       ccExit_;
         ConsoleCommand*       ccSelectGameState_;
+        ConsoleCommand*       ccSetTimeFactor_;
     };
 }
