Changeset 568 for code/branches/FICN/src/orxonox/orxonox.cc
- Timestamp:
- Dec 17, 2007, 12:09:13 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/orxonox.cc
r565 r568 217 217 //TODO: read config file 218 218 //TODO: give config file to Ogre 219 std::string mode = ""; 219 std::string mode; 220 if(argc>=2) 221 mode = std::string(argv[1]); 222 else 223 mode = ""; 220 224 ArgReader ar = ArgReader(argc, argv); 221 225 ar.checkArgument("mode", mode, false); … … 226 230 { 227 231 serverInit(path); 232 mode = SERVER; 228 233 } 229 234 else if(mode == std::string("client")) 230 235 { 231 236 clientInit(path); 237 mode = CLIENT; 232 238 } 233 239 else if(mode == std::string("presentation")) 234 240 { 235 playableServer(path); 236 } 237 else 238 standalone(path); 241 serverInit(path); 242 mode = PRESENTATION; 243 } 244 else{ 245 standaloneInit(path); 246 mode = STANDALONE; 247 } 239 248 } 240 249 … … 252 261 createFrameListener(); 253 262 Factory::createClassHierarchy(); 263 switch(mode_){ 264 case PRESENTATION: 265 server_g->open(); 266 break; 267 case SERVER: 268 case CLIENT: 269 case STANDALONE: 270 default: 271 break; 272 } 254 273 startRenderLoop(); 255 274 } … … 274 293 } 275 294 276 void Orxonox::standalone (std::string path)295 void Orxonox::standaloneInit(std::string path) 277 296 { 278 297 ogre_->setConfigPath(path); … … 320 339 startRenderLoop(); 321 340 } 341 342 void Orxonox::standalone(){ 343 344 345 346 } 322 347 323 348 void Orxonox::serverInit(std::string path) … … 327 352 server_g = new network::Server(); // add some settings if wanted 328 353 if(!ogre_->load()) die(/* unable to load */); 354 // add network framelistener 329 355 ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); 330 ogre_->startRender();331 332 createScene();333 setupScene();334 356 } 335 357 … … 341 363 if(!ogre_->load()) die(/* unable to load */); 342 364 ogre_->getRoot()->addFrameListener(new network::ClientFrameListener()); 343 ogre_->startRender();344 345 createScene();346 setupScene();347 setupInputSystem();348 createFrameListener();349 startRenderLoop();350 365 } 351 366
Note: See TracChangeset
for help on using the changeset viewer.