Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3216 in orxonox.OLD for orxonox/trunk/src/world.cc


Ignore:
Timestamp:
Dec 18, 2004, 5:14:08 AM (21 years ago)
Author:
patrick
Message:

orxonox/trunk: a first redesign of the CommandNode and its cmd passing system - others will follow.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world.cc

    r3215 r3216  
    6464{
    6565  this->bPause = false;
    66   Orxonox::getInstance()->get_localinput()->enable(true);
     66  CommandNode* cn = Orxonox::getInstance()->get_localinput();
     67  cn->addToWorld(this);
     68  cn->enable(true);
    6769}
    6870
     
    7880  this->localPlayer->destroy();
    7981  this->localCamera->destroy();
    80 
    8182
    8283  WorldEntity* entity = entities->enumerate(); 
     
    610611{
    611612  // localinput
    612   Orxonox::getInstance()->get_localinput()->process();
     613  CommandNode* cn = Orxonox::getInstance()->get_localinput();
     614  cn->process();
    613615  // remoteinput
    614616}
     
    643645}
    644646
     647
    645648/**
    646649   \brief compute collision detection
     
    651654}
    652655
    653 /**
    654    \brief handle keyboard commands that are not meant for WorldEntities
    655    \param cmd: the command to handle
    656    \return true if the command was handled by the system or false if it may be passed to the WorldEntities
    657 */
    658 bool World::system_command (Command* cmd)
    659 {
    660   if( !strcmp( cmd->cmd, "quit"))
    661     {
    662       if( !cmd->bUp) this->bQuitOrxonox = true;
    663       {
    664         printf("World::system_command() - rescv quit command\n");
    665         return true;
    666       }
    667     }
    668   return false;
    669 }
    670656
    671657/**
     
    750736  //return entity;
    751737}
     738
     739
     740bool World::command(Command* cmd)
     741{
     742  if( !strcmp( cmd->cmd, "quit"))
     743    {
     744      if( !cmd->bUp) this->stop();
     745      return true;
     746    }
     747  return false;
     748}
Note: See TracChangeset for help on using the changeset viewer.