Changeset 1640 for code/branches/gui/src/orxonox/Orxonox.cc
- Timestamp:
- Jul 21, 2008, 8:39:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/Orxonox.cc
r1638 r1640 250 250 ogre_->getWindowWidth(), ogre_->getWindowHeight(), true, true, true); 251 251 KeyBinder* keyBinder = new KeyBinder(); 252 keyBinder->loadBindings(); 252 253 InputManager::createSimpleInputState("game", 20)->setHandler(keyBinder); 253 254 … … 277 278 { 278 279 // show main menu 279 //GraphicsEngine::getSingleton().createNewScene();280 G UIManager::getInstance().showGUI("MainMenu", true);280 GUIManager::getInstance().showGUI("MainMenu", 0); 281 GraphicsEngine::getSingleton().getViewport()->setCamera(GUIManager::getInstance().getCamera()); 281 282 } 282 283 } … … 340 341 341 342 if (success) 343 { 342 344 InputManager::requestEnterState("game"); 345 this->mode_ = mode; 346 } 343 347 344 348 return success; … … 450 454 unsigned long frameCount = 0; 451 455 452 const unsigned long refreshTime = debugRefreshTime_ * 1000000.0f; 456 const unsigned long refreshTime = 50000.0f; 457 //const unsigned long refreshTime = debugRefreshTime_ * 1000000.0f; 453 458 unsigned long refreshStartTime = 0; 454 459 unsigned long tickTime = 0; … … 458 463 unsigned long timeBeforeTickOld = 0; 459 464 unsigned long timeAfterTick = 0; 460 461 int sleepTime = 0;462 465 463 466 // TODO: Update time in seconds every 7 seconds to avoid any overflow (7 secs is very tight) … … 511 514 GraphicsEngine::getSingleton().setAverageFramesPerSecond(avgFPS); 512 515 513 if (avgFPS > 60.0)514 sleepTime++;515 else516 sleepTime--;517 if (sleepTime < 0)518 sleepTime = 0;519 520 516 oldFrameCount = frameCount; 521 517 tickTime = 0; 522 518 refreshStartTime = timeAfterTick; 523 519 } 524 525 // do some sleeping when the frameRate is over 60526 if (sleepTime > 0)527 msleep(sleepTime);528 529 520 530 521 // don't forget to call _fireFrameStarted in ogre to make sure
Note: See TracChangeset
for help on using the changeset viewer.