Changeset 1672 for code/branches/gui/src/orxonox/gamestates/GSRoot.cc
- Timestamp:
- Aug 27, 2008, 10:21:39 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/gamestates/GSRoot.cc
r1670 r1672 41 41 #include "core/Core.h" 42 42 #include "core/CommandLine.h" 43 #include "core/TclThreadManager.h" 43 44 #include "GraphicsEngine.h" 44 45 #include "Settings.h" … … 49 50 50 51 GSRoot::GSRoot() 51 : GameState("root")52 : RootGameState("root") 52 53 , settings_(0) 53 54 , graphicsEngine_(0) 54 , bExit_(false)55 55 { 56 56 } … … 113 113 // initialise TCL 114 114 TclBind::getInstance().setDataPath(Settings::getDataPath()); 115 TclThreadManager::getInstance(); 115 116 116 117 // initialise graphics engine. Doesn't load the render window yet! … … 118 119 graphicsEngine_->setup(); // creates ogre root and other essentials 119 120 120 // console commands121 FunctorMember<GSRoot>* functor = createFunctor(&GSRoot::loadGame);122 functor ->setObject(this);123 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor , "loadGame"));121 // add console commands 122 FunctorMember<GSRoot>* functor1 = createFunctor(&GSRoot::exitGame); 123 functor1->setObject(this); 124 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor1, "exit")); 124 125 125 126 // add console commands 126 functor = createFunctor(&GSRoot::exitGame);127 functor ->setObject(this);128 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor , "exit"));127 FunctorMember01<GameState, const std::string&>* functor2 = createFunctor(&GameState::requestState); 128 functor2->setObject(this); 129 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(functor2, "selectGameState")); 129 130 } 130 131 … … 137 138 } 138 139 139 void GSRoot::ticked(float dt )140 void GSRoot::ticked(float dt, uint64_t time) 140 141 { 141 this->tickChild(dt); 142 } 142 TclThreadManager::getInstance().tick(dt); 143 143 144 /** 145 @brief 146 Requests a state. 147 */ 148 void GSRoot::loadGame(const std::string& name) 149 { 150 this->requestState(name); 144 this->tickChild(dt, time); 151 145 } 152 146 }
Note: See TracChangeset
for help on using the changeset viewer.