Changeset 2927
- Timestamp:
- Apr 19, 2009, 10:59:59 PM (16 years ago)
- Location:
- code/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/core/Game.cc
r2896 r2927 106 106 delete this->core_; 107 107 108 // Delete all GameStates created by the macros109 for (std:: map<std::string, GameState*>::const_iterator it = allStates_s.begin(); it != allStates_s.end(); ++it)110 delete it->second;108 // Delete all the created nodes 109 for (std::vector<GameStateTreeNode*>::const_iterator it = this->allStateNodes_.begin(); it != this->allStateNodes_.end(); ++it) 110 delete *it; 111 111 112 112 delete this->gameClock_; … … 320 320 ThrowException(GameState, "No two root GameStates are allowed!"); 321 321 GameStateTreeNode* newNode = new GameStateTreeNode; 322 this->allStateNodes_.push_back(newNode); 322 323 newNode->state_ = newState; 323 324 newNode->parent_ = 0; … … 328 329 { 329 330 GameStateTreeNode* newNode = new GameStateTreeNode; 331 this->allStateNodes_.push_back(newNode); 330 332 newNode->state_ = newState; 331 333 if (newLevel < currentLevel) … … 391 393 return true; 392 394 } 395 396 /*static*/ void Game::destroyStates() 397 { 398 // Delete all GameStates created by the macros 399 for (std::map<std::string, GameState*>::const_iterator it = allStates_s.begin(); it != allStates_s.end(); ++it) 400 delete it->second; 401 allStates_s.clear(); 402 } 393 403 } -
code/trunk/src/core/Game.h
r2896 r2927 77 77 78 78 static bool addGameState(GameState* state); 79 static void destroyStates(); 79 80 static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 80 81 … … 95 96 GameStateTreeNode* activeStateNode_; 96 97 std::vector<GameStateTreeNode*> requestedStateNodes_; 98 std::vector<GameStateTreeNode*> allStateNodes_; 97 99 98 100 Core* core_; -
code/trunk/src/orxonox/Main.cc
r2896 r2927 69 69 70 70 orxonox.run(); 71 72 // destroy the GameStates created pre-mainly 73 orxonox::Game::destroyStates(); 71 74 } // orxonox gets destroyed right here! 72 75 -
code/trunk/src/orxonox/gamestates/GSMainMenu.cc
r2896 r2927 86 86 InputManager::getInstance().requestDestroyState("mainMenu"); 87 87 88 /* 88 GUIManager::getInstance().setCamera(0); 89 GraphicsManager::getInstance().setCamera(0); 90 this->scene_->getSceneManager()->destroyCamera(this->camera_); 91 delete this->scene_; 92 89 93 if (this->ccStartGame_) 90 94 { … … 92 96 this->ccStartGame_ = 0; 93 97 } 94 */95 98 } 96 99 -
code/trunk/src/orxonox/gui/GUIManager.cc
r2896 r2927 252 252 void GUIManager::setCamera(Ogre::Camera* camera) 253 253 { 254 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); 254 if (camera == NULL) 255 this->guiRenderer_->setTargetSceneManager(0); 256 else 257 this->guiRenderer_->setTargetSceneManager(camera->getSceneManager()); 255 258 } 256 259
Note: See TracChangeset
for help on using the changeset viewer.