Changeset 3220 in orxonox.OLD for orxonox/trunk/src/world.cc
- Timestamp:
- Dec 19, 2004, 9:09:36 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world.cc
r3216 r3220 51 51 World::~World () 52 52 { 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"); 66 54 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(); 81 57 this->localCamera->destroy(); 82 58 … … 88 64 } 89 65 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 */ 77 Error World::init() 78 { 79 this->bPause = false; 80 CommandNode* cn = Orxonox::getInstance()->get_localinput(); 81 cn->addToWorld(this); 82 cn->enable(true); 83 } 84 85 Error 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 93 Error World::stop() 94 { 95 printf("World::stop() - got stop signal\n"); 96 this->bQuitCurrentGame = true; 91 97 } 92 98 … … 568 574 { 569 575 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"); 573 577 while( !this->bQuitOrxonox && !this->bQuitCurrentGame) /* \todo implement pause */ 574 578 { … … 740 744 bool World::command(Command* cmd) 741 745 { 742 if( !strcmp( cmd->cmd, "quit"))743 {744 if( !cmd->bUp) this->stop();745 return true;746 }747 746 return false; 748 747 }
Note: See TracChangeset
for help on using the changeset viewer.