Changeset 1802 for code/trunk
- Timestamp:
- Sep 21, 2008, 12:18:01 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/RootGameState.cc
r1764 r1802 132 132 void RootGameState::start(int argc, char** argv) 133 133 { 134 // start global orxonox time 135 Clock clock; 136 137 // create the Core settings to configure the output level 138 Core::getInstance(); 139 140 parseArguments(argc, argv); 141 142 this->activate(); 143 144 // get initial state from command line 145 std::string initialState; 146 CommandLine::getValue<std::string>("state", &initialState); 147 gotoState(initialState); 148 149 while (this->activeChild_) 150 { 151 clock.capture(); 152 153 this->tick(clock); 154 155 if (this->stateRequest_ != "") 156 gotoState(stateRequest_); 157 } 158 159 this->deactivate(); 134 try 135 { 136 // start global orxonox time 137 Clock clock; 138 139 // create the Core settings to configure the output level 140 Core::getInstance(); 141 142 parseArguments(argc, argv); 143 144 this->activate(); 145 146 // get initial state from command line 147 std::string initialState; 148 CommandLine::getValue<std::string>("state", &initialState); 149 gotoState(initialState); 150 151 while (this->activeChild_) 152 { 153 clock.capture(); 154 155 this->tick(clock); 156 157 if (this->stateRequest_ != "") 158 gotoState(stateRequest_); 159 } 160 161 this->deactivate(); 162 } 163 // Note: These are all unhandled exceptions that should not have made its way here! 164 // almost complete game catch block to display the messages appropriately. 165 catch (std::exception& ex) 166 { 167 COUT(1) << ex.what() << std::endl; 168 COUT(1) << "Program aborted." << std::endl; 169 abort(); 170 } 171 // anything that doesn't inherit from std::exception 172 catch (...) 173 { 174 COUT(1) << "An unidentifiable exception has occured. Program aborted." << std::endl; 175 abort(); 176 } 160 177 } 161 178
Note: See TracChangeset
for help on using the changeset viewer.