Changeset 1219 for code/trunk/src/orxonox/Orxonox.cc
- Timestamp:
- May 2, 2008, 10:44:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/Orxonox.cc
r1214 r1219 85 85 namespace orxonox 86 86 { 87 ConsoleCommand (Orxonox, exit, AccessLevel::None, true);88 ConsoleCommand (Orxonox, slomo, AccessLevel::Offline, true).setDefaultValue(0, 1.0);89 ConsoleCommand (Orxonox, setTimeFactor, AccessLevel::Offline, false).setDefaultValue(0, 1.0);90 87 ConsoleCommandShortcut(Orxonox, exit, AccessLevel::None); 88 ConsoleCommandShortcut(Orxonox, slomo, AccessLevel::Offline).setDefaultValue(0, 1.0); 89 ConsoleCommandShortcut(Orxonox, setTimeFactor, AccessLevel::Offline).setDefaultValue(0, 1.0); 90 ConsoleCommandShortcut(Orxonox, activateConsole, AccessLevel::None); 91 91 class Testconsole : public InputBufferListener 92 92 { … … 119 119 void exit() const 120 120 { 121 CommandExecutor::execute("setInputMode 2");121 InputManager::setInputState(InputManager::IS_NORMAL); 122 122 } 123 123 … … 185 185 delete this->orxonoxHUD_; 186 186 Loader::close(); 187 InputManager:: getSingleton().destroy();187 InputManager::destroy(); 188 188 if (this->auMan_) 189 189 delete this->auMan_; … … 400 400 void Orxonox::setupInputSystem() 401 401 { 402 inputHandler_ = &InputManager::getSingleton(); 403 if (!inputHandler_->initialise(ogre_->getWindowHandle(), 402 if (!InputManager::initialise(ogre_->getWindowHandle(), 404 403 ogre_->getWindowWidth(), ogre_->getWindowHeight())) 405 404 abortImmediateForce(); 406 inputHandler_->setInputMode(IM_INGAME);405 InputManager::setInputState(InputManager::IS_NORMAL); 407 406 } 408 407 … … 423 422 void Orxonox::startRenderLoop() 424 423 { 425 InputBuffer* ib = new InputBuffer(); 426 InputManager::getSingleton().feedInputBuffer(ib); 424 InputBuffer* ib = dynamic_cast<InputBuffer*>(InputManager::getKeyHandler("buffer")); 427 425 /* 428 426 Testconsole* console = new Testconsole(ib); … … 459 457 eventTimes[i].clear(); 460 458 // fill the fps time list with zeros 461 for (int i = 0; i < 20; i++)459 for (int i = 0; i < 50; i++) 462 460 eventTimes[3].push_back(0); 463 461 … … 485 483 // show the current time in the HUD 486 484 orxonoxHUD_->setTime((int)now, 0); 485 orxonoxHUD_->setRocket2(ogreRoot.getCurrentFrameNumber()); 487 486 if (eventTimes[3].back() - eventTimes[3].front() != 0) 488 orxonoxHUD_->setRocket1((int)( 20000.0f/(eventTimes[3].back() - eventTimes[3].front())));487 orxonoxHUD_->setRocket1((int)(50000.0f/(eventTimes[3].back() - eventTimes[3].front()))); 489 488 490 489 // Iterate through all Tickables and call their tick(dt) function … … 551 550 } 552 551 553 /** 554 @brief Test method for the InputHandler. 555 But: Is actually responsible for catching an exit event.. 556 */ 557 void Orxonox::eventOccured(InputEvent &evt) 558 { 559 if (evt.id == 1) 560 this->abortRequest(); 552 void Orxonox::activateConsole() 553 { 554 InputManager::setInputState(InputManager::IS_CONSOLE); 561 555 } 562 556 }
Note: See TracChangeset
for help on using the changeset viewer.