Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 19, 2004, 9:09:36 PM (21 years ago)
Author:
patrick
Message:

orxonox/trunk: fixed a lot of bugs with StoryEntity management, also cleared up some old unused code

File:
1 edited

Legend:

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

    r3216 r3220  
    5151World::~World ()
    5252{
    53   Orxonox *orx = Orxonox::getInstance();
    54   orx->get_localinput()->unbind (this->localPlayer);
    55   delete this->entities;
    56   delete this->localCamera;
    57 }
    58 
    59 
    60 /**
    61     \brief initialize the world before use.
    62 */
    63 Error World::init()
    64 {
    65   this->bPause = false;
     53  printf("World::~World() - deleting current world\n");
    6654  CommandNode* cn = Orxonox::getInstance()->get_localinput();
    67   cn->addToWorld(this);
    68   cn->enable(true);
    69 }
    70 
    71 Error World::start()
    72 {
    73   this->mainLoop();
    74 }
    75 
    76 Error World::stop()
    77 {
    78   this->bQuitCurrentGame = true;
    79   //this->localCamera->setWorld(NULL);
    80   this->localPlayer->destroy();
     55  cn->unbind(this->localPlayer);
     56  cn->reset();
    8157  this->localCamera->destroy();
    8258
     
    8864    }
    8965  this->entities->destroy();
    90   Orxonox::getInstance()->get_localinput()->reset();
     66
     67  delete this->entities;
     68  delete this->localCamera;
     69  /* this->localPlayer hasn't to be deleted explicitly, it is
     70     contained in entities*/
     71}
     72
     73
     74/**
     75    \brief initialize the world before use.
     76*/
     77Error World::init()
     78{
     79  this->bPause = false;
     80  CommandNode* cn = Orxonox::getInstance()->get_localinput();
     81  cn->addToWorld(this);
     82  cn->enable(true);
     83}
     84
     85Error World::start()
     86{
     87  printf("World::start() - starting current World: nr %i\n", this->debugWorldNr);
     88  this->bQuitOrxonox = false;
     89  this->bQuitCurrentGame = false;
     90  this->mainLoop();
     91}
     92
     93Error World::stop()
     94{
     95  printf("World::stop() - got stop signal\n");
     96  this->bQuitCurrentGame = true;
    9197}
    9298
     
    568574{
    569575  this->lastFrame = SDL_GetTicks();
    570   this->bQuitOrxonox = false;
    571   this->bQuitCurrentGame = false;
    572   printf("World|Entering main loop\n");
     576  printf("World::mainLoop() - Entering main loop\n");
    573577  while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */
    574578    {
     
    740744bool World::command(Command* cmd)
    741745{
    742   if( !strcmp( cmd->cmd, "quit"))
    743     {
    744       if( !cmd->bUp) this->stop();
    745       return true;
    746     }
    747746  return false;
    748747}
Note: See TracChangeset for help on using the changeset viewer.