Changeset 2845 for code/branches/gui/src/core
- Timestamp:
- Mar 25, 2009, 5:33:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/Game.cc
r2844 r2845 50 50 namespace orxonox 51 51 { 52 void stop_game() 53 { 54 Game::getInstance().stop(); 55 } 52 static void stop_game() 53 { Game::getInstance().stop(); } 54 SetConsoleCommandShortcutExternAlias(stop_game, "exit"); 56 55 57 56 struct _CoreExport GameStateTreeNode … … 61 60 std::vector<GameStateTreeNode*> children_; 62 61 }; 63 64 SetCommandLineArgument(state, "gui").shortcut("s");65 SetCommandLineSwitch(startWithConsole);66 SetConsoleCommandShortcutExternAlias(stop_game, "exit");67 62 68 63 std::map<std::string, GameState*> Game::allStates_s; … … 132 127 void Game::run() 133 128 { 134 // </EXPORT THIS> 135 this->setStateHierarchy( 136 "root" 137 " graphics" 138 " gui" 139 " standalone" 140 " level" 141 " server" 142 " level" 143 " client" 144 " level" 145 " dedicated" 146 " level" 147 " ioConsole" 148 ); 149 // </EXPORT THIS> 150 151 152 // Always start with the root state 129 // Always start with the ROOT state 153 130 this->requestedStateNodes_.push_back(this->rootStateNode_); 154 131 this->activeStateNode_ = this->rootStateNode_; 155 132 this->loadState(this->rootStateNode_->state_); 156 133 157 // <EXPORT THIS> 158 if (CommandLine::getValue("startWithConsole").getBool()) 159 { 160 // Start the game in the console 161 this->requestState("ioConsole"); 162 } 163 else 164 { 165 // Start in GUI main menu 166 this->requestState("graphics"); 167 this->requestState("gui"); 168 } 169 // </EXPORT THIS> 170 134 // START GAME 171 135 this->gameClock_->capture(); // first delta time should be about 0 seconds 172 136 while (!this->abort_ && !this->activeStates_.empty()) … … 224 188 } 225 189 226 // U nloadall remaining states190 // UNLOAD all remaining states 227 191 while (!this->activeStates_.empty()) 228 192 this->unloadState(this->activeStates_.back());
Note: See TracChangeset
for help on using the changeset viewer.