Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2008, 10:44:57 PM (16 years ago)
Author:
rgrieder
Message:

merged input branch back to trunk. Not yet tested on tardis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/Orxonox.cc

    r1214 r1219  
    8585namespace orxonox
    8686{
    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);
    9191  class Testconsole : public InputBufferListener
    9292  {
     
    119119      void exit() const
    120120      {
    121         CommandExecutor::execute("setInputMode 2");
     121        InputManager::setInputState(InputManager::IS_NORMAL);
    122122      }
    123123
     
    185185      delete this->orxonoxHUD_;
    186186    Loader::close();
    187     InputManager::getSingleton().destroy();
     187    InputManager::destroy();
    188188    if (this->auMan_)
    189189      delete this->auMan_;
     
    400400  void Orxonox::setupInputSystem()
    401401  {
    402     inputHandler_ = &InputManager::getSingleton();
    403     if (!inputHandler_->initialise(ogre_->getWindowHandle(),
     402    if (!InputManager::initialise(ogre_->getWindowHandle(),
    404403          ogre_->getWindowWidth(), ogre_->getWindowHeight()))
    405404      abortImmediateForce();
    406     inputHandler_->setInputMode(IM_INGAME);
     405    InputManager::setInputState(InputManager::IS_NORMAL);
    407406  }
    408407
     
    423422  void Orxonox::startRenderLoop()
    424423  {
    425     InputBuffer* ib = new InputBuffer();
    426     InputManager::getSingleton().feedInputBuffer(ib);
     424    InputBuffer* ib = dynamic_cast<InputBuffer*>(InputManager::getKeyHandler("buffer"));
    427425    /*
    428426    Testconsole* console = new Testconsole(ib);
     
    459457      eventTimes[i].clear();
    460458    // fill the fps time list with zeros
    461     for (int i = 0; i < 20; i++)
     459    for (int i = 0; i < 50; i++)
    462460      eventTimes[3].push_back(0);
    463461
     
    485483      // show the current time in the HUD
    486484      orxonoxHUD_->setTime((int)now, 0);
     485      orxonoxHUD_->setRocket2(ogreRoot.getCurrentFrameNumber());
    487486      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())));
    489488
    490489      // Iterate through all Tickables and call their tick(dt) function
     
    551550  }
    552551
    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);
    561555  }
    562556}
Note: See TracChangeset for help on using the changeset viewer.