Changeset 1244 for code/branches/ogre/src/orxonox/Orxonox.cc
- Timestamp:
- May 7, 2008, 9:20:42 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ogre/src/orxonox/Orxonox.cc
r1243 r1244 37 37 38 38 //****** STD ******* 39 //#include <iostream>40 //#include <exception>41 39 #include <deque> 42 40 43 41 //****** OGRE ****** 44 //#include <OgreException.h>45 42 #include <OgreFrameListener.h> 46 43 #include <OgreOverlay.h> … … 159 156 160 157 /** 161 * create a new instance of Orxonox158 * Create a new instance of Orxonox. Avoid doing any actual work here. 162 159 */ 163 160 Orxonox::Orxonox() … … 177 174 178 175 /** 179 * destruct Orxonox176 * Destruct Orxonox. 180 177 */ 181 178 Orxonox::~Orxonox() … … 208 205 209 206 /** 210 * @return singleton object207 * @return singleton reference 211 208 */ 212 209 Orxonox* Orxonox::getSingleton() … … 248 245 return false; 249 246 247 COUT(3) << "*** Orxonox: Mode is " << mode << "." << std::endl; 250 248 if (mode == "client") 251 249 mode_ = CLIENT; … … 260 258 261 259 // for playable server, client and standalone, the startup 262 // procedure until the GUI is theidentical260 // procedure until the GUI is identical 263 261 264 262 TclBind::getInstance().setDataPath(dataPath); … … 284 282 return false; 285 283 286 // Calls the Input Handler which sets up the input devices.284 // Calls the InputManager which sets up the input devices. 287 285 // The render window width and height are used to set up the mouse movement. 288 286 if (!InputManager::initialise(ogre_->getWindowHandle(), … … 290 288 return false; 291 289 292 // TODO: Spread this so that this call onyl initialises things needed for the GUI 293 ogre_->initialiseResources(); 290 // TODO: Spread this so that this call only initialises things needed for the GUI 291 if (!ogre_->initialiseResources()) 292 return false; 294 293 295 294 // TOOD: load the GUI here … … 298 297 // TODO: run GUI here 299 298 300 // The following lines depend very much on the GUI , so they're probably misplaced here..299 // The following lines depend very much on the GUI output, so they're probably misplaced here.. 301 300 302 301 InputManager::setInputState(InputManager::IS_NONE); … … 325 324 } 326 325 326 /** 327 * Loads everything in the scene except for the actual objects. 328 * This includes HUD, Console.. 329 */ 327 330 bool Orxonox::loadPlayground() 328 331 { … … 338 341 339 342 // Load the HUD 343 COUT(3) << "*** Orxonox: Loading HUD..." << std::endl; 340 344 Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2"); 341 345 orxonoxHUD_ = new HUD(); … … 344 348 hudOverlay->show(); 345 349 350 COUT(3) << "*** Orxonox: Loading Console..." << std::endl; 346 351 InputBuffer* ib = dynamic_cast<InputBuffer*>(InputManager::getKeyHandler("buffer")); 347 352 /* … … 365 370 } 366 371 372 /** 373 * Level loading method for server mode. 374 */ 367 375 bool Orxonox::serverLoad() 368 376 { 369 COUT(2) << " initialising server" << std::endl;377 COUT(2) << "Loading level in server mode" << std::endl; 370 378 371 379 server_g = new network::Server(); … … 379 387 } 380 388 389 /** 390 * Level loading method for client mode. 391 */ 381 392 bool Orxonox::clientLoad() 382 393 { 383 COUT(2) << " initialising client" << std::endl;\394 COUT(2) << "Loading level in client mode" << std::endl;\ 384 395 385 396 if (serverIp_.compare("") == 0) … … 394 405 } 395 406 407 /** 408 * Level loading method for standalone mode. 409 */ 396 410 bool Orxonox::standaloneLoad() 397 411 { 398 COUT(2) << " initialisingstandalone mode" << std::endl;412 COUT(2) << "Loading level in standalone mode" << std::endl; 399 413 400 414 if (!loadScene()) … … 404 418 } 405 419 420 /** 421 * Helper method to load a level. 422 */ 406 423 bool Orxonox::loadScene() 407 424 { … … 447 464 timer_->reset(); 448 465 466 COUT(3) << "*** Orxonox: Starting the main loop." << std::endl; 449 467 while (!bAbort_) 450 468 { … … 534 552 } 535 553 554 /** 555 * Static function that shows the console in game mode. 556 */ 536 557 void Orxonox::activateConsole() 537 558 { 559 // currently, the console shows itself when feeded with input. 538 560 InputManager::setInputState(InputManager::IS_CONSOLE); 539 561 }
Note: See TracChangeset
for help on using the changeset viewer.