Changeset 2844 for code/branches/gui/src/orxonox/gamestates/GSRoot.cc
- Timestamp:
- Mar 25, 2009, 5:23:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSRoot.cc
r2843 r2844 32 32 #include "util/Exception.h" 33 33 #include "util/Debug.h" 34 #include "core/Clock.h" 34 35 #include "core/Core.h" 35 #include "core/CoreIncludes.h"36 36 #include "core/ConsoleCommand.h" 37 37 #include "tools/TimeFactorListener.h" 38 38 #include "tools/Timer.h" 39 39 #include "objects/Tickable.h" 40 #include " Game.h"40 #include "core/Game.h" 41 41 42 42 namespace orxonox 43 43 { 44 GSRoot::GSRoot() 45 : RootGameState("root") 44 AddGameState(GSRoot, "root"); 45 46 GSRoot::GSRoot(const std::string& name) 47 : GameState(name) 46 48 , timeFactor_(1.0f) 47 49 , bPaused_(false) … … 56 58 } 57 59 58 void GSRoot:: enter()60 void GSRoot::activate() 59 61 { 60 62 // reset game speed to normal 61 63 timeFactor_ = 1.0f; 62 63 {64 // add console commands65 FunctorMember01<GameState, const std::string&>* functor = createFunctor(&GameState::requestState);66 functor->setObject(this);67 this->ccSelectGameState_ = createConsoleCommand(functor, "selectGameState");68 CommandExecutor::addConsoleCommandShortcut(this->ccSelectGameState_);69 }70 64 71 65 { … … 86 80 } 87 81 88 void GSRoot:: leave()82 void GSRoot::deactivate() 89 83 { 90 // destroy console commands91 delete this->ccSelectGameState_;92 93 84 if (this->ccSetTimeFactor_) 94 85 { … … 104 95 } 105 96 106 void GSRoot:: ticked(const Clock& time)97 void GSRoot::update(const Clock& time) 107 98 { 108 99 uint64_t timeBeforeTick = time.getRealMicroseconds(); … … 129 120 // Also add our tick time to the list in GSRoot 130 121 Game::getInstance().addTickTime(timeAfterTick - timeBeforeTick); 131 132 this->tickChild(time);133 122 } 134 123
Note: See TracChangeset
for help on using the changeset viewer.