Changeset 1642 for code/branches/gui/src/orxonox/Orxonox.cc
- Timestamp:
- Jul 23, 2008, 3:37:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/Orxonox.cc
r1641 r1642 104 104 */ 105 105 Orxonox::Orxonox() 106 : ogre_(0) 107 , startLevel_(0) 106 : startLevel_(0) 108 107 , hud_(0) 109 , radar_(0)110 108 //, auMan_(0) 111 109 , timer_(0) … … 114 112 , mode_(GameMode::GM_Unspecified) 115 113 , debugRefreshTime_(0.0f) 114 , ogre_(0) 115 , inputManager_(0) 116 , radar_(0) 116 117 { 117 118 RegisterRootObject(Orxonox); 118 119 119 assert(singletonRef_s == 0); 120 //assert(singletonRef_s == 0); 121 OrxAssert(singletonRef_s == 0, "asdfasdfasdfasdfblahblah"); 120 122 singletonRef_s = this; 121 123 } … … 127 129 { 128 130 // keep in mind: the order of deletion is very important! 129 Loader::unload(); 131 if (this->timer_) 132 delete this->timer_; 133 134 Loader::unload(startLevel_); 130 135 if (this->startLevel_) 131 136 delete this->startLevel_; … … 138 143 delete this->radar_; 139 144 140 Loader::close();141 145 //if (this->auMan_) 142 146 // delete this->auMan_; 143 InGameConsole::getInstance().destroy(); 144 if (this->timer_) 145 delete this->timer_; 146 InputManager::destroy(); 147 148 if (this->console_) 149 delete this->console_; 150 151 if (inputManager_) 152 delete inputManager_; 147 153 148 154 if (this->ogre_) … … 153 159 if (server_g) 154 160 delete network::Server::getSingleton(); 161 162 // this call will delete every BaseObject! 163 // But currently this will call methods of objects that exist no more 164 // The only 'memory leak' is the ParticleSpawer. They would be deleted here 165 // and call a sceneNode method that has already been destroy by the corresponding space ship. 166 //Loader::close(); 155 167 156 168 singletonRef_s = 0; … … 247 259 // Calls the InputManager which sets up the input devices. 248 260 // The render window width and height are used to set up the mouse movement. 249 InputManager::initialise(ogre_->getWindowHandle(), 261 inputManager_ = new InputManager(); 262 inputManager_->initialise(ogre_->getWindowHandle(), 250 263 ogre_->getWindowWidth(), ogre_->getWindowHeight(), true, true, true); 251 264 KeyBinder* keyBinder = new KeyBinder(); 252 265 keyBinder->loadBindings(); 253 InputManager::createSimpleInputState("game", 20)->setHandler(keyBinder);266 inputManager_->createSimpleInputState("game", 20)->setHandler(keyBinder); 254 267 255 268 // Load the InGameConsole 256 InGameConsole::getInstance().initialise(); 269 console_ = new InGameConsole(); 270 console_->initialise(); 257 271 258 272 // load the CEGUI interface … … 342 356 if (success) 343 357 { 344 InputManager:: requestEnterState("game");358 InputManager::getInstance().requestEnterState("game"); 345 359 this->mode_ = mode; 346 360 }
Note: See TracChangeset
for help on using the changeset viewer.