Changeset 5876 for code/branches/core5/src/orxonox/gamestates/GSLevel.cc
- Timestamp:
- Oct 4, 2009, 11:08:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/gamestates/GSLevel.cc
r5863 r5876 37 37 #include "core/input/KeyBinderManager.h" 38 38 #include "core/ConsoleCommand.h" 39 #include "core/ConfigValueIncludes.h"40 #include "core/CoreIncludes.h"41 39 #include "core/Game.h" 42 40 #include "core/GameMode.h" … … 51 49 { 52 50 DeclareGameState(GSLevel, "level", false, false); 53 SetConsoleCommand(GSLevel, showIngameGUI, true);54 55 XMLFile* GSLevel::startFile_s = NULL;56 51 57 52 GSLevel::GSLevel(const GameStateInfo& info) … … 60 55 , guiMouseOnlyInputState_(0) 61 56 , guiKeysOnlyInputState_(0) 57 , startFile_(0) 62 58 { 63 RegisterObject(GSLevel);64 59 } 65 60 … … 68 63 } 69 64 70 void GSLevel::setConfigValues()71 {72 }73 74 65 void GSLevel::activate() 75 66 { 76 setConfigValues();77 78 67 if (GameMode::showsGraphics()) 79 68 { … … 87 76 guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly"); 88 77 guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr()); 78 79 CommandExecutor::addConsoleCommandShortcut(createConsoleCommand(createFunctor(&GSLevel::showIngameGUI, this), "showIngameGUI")); 89 80 } 90 81 … … 129 120 // unload all compositors (this is only necessary because we don't yet destroy all resources!) 130 121 Ogre::CompositorManager::getSingleton().removeAll(); 131 }132 122 133 // this call will delete every BaseObject!134 // But currently this will call methods of objects that exist no more135 // The only 'memory leak' is the ParticleSpawer. They would be deleted here136 // and call a sceneNode method that has already been destroy by the corresponding space ship.137 //Loader::close();138 139 if (GameMode::showsGraphics())140 {141 123 InputManager::getInstance().leaveState("game"); 142 124 } … … 158 140 void GSLevel::update(const Clock& time) 159 141 { 160 // Note: Temporarily moved to GS Graphics.142 // Note: Temporarily moved to GSRoot. 161 143 //// Call the scene objects 162 144 //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it) … … 168 150 // call the loader 169 151 COUT(0) << "Loading level..." << std::endl; 170 startFile_ s= new XMLFile(LevelManager::getInstance().getDefaultLevel());171 Loader::open(startFile_ s);152 startFile_ = new XMLFile(LevelManager::getInstance().getDefaultLevel()); 153 Loader::open(startFile_); 172 154 } 173 155 174 156 void GSLevel::unloadLevel() 175 157 { 176 Loader::unload(startFile_s); 177 178 delete startFile_s; 158 Loader::unload(startFile_); 159 delete startFile_; 179 160 } 180 161 }
Note: See TracChangeset
for help on using the changeset viewer.