Changeset 5850 for code/branches/core5/src/orxonox/gamestates
- Timestamp:
- Oct 1, 2009, 11:44:53 AM (15 years ago)
- Location:
- code/branches/core5/src/orxonox/gamestates
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/gamestates/GSGraphics.cc
r5842 r5850 46 46 #include "core/Loader.h" 47 47 #include "core/XMLFile.h" 48 #include "overlays/InGameConsole.h"49 #include "sound/SoundManager.h"50 48 51 49 // HACK: … … 58 56 GSGraphics::GSGraphics(const GameStateInfo& info) 59 57 : GameState(info) 60 , console_(0)61 , soundManager_(0)62 58 , masterKeyBinder_(0) 63 59 , masterInputState_(0) … … 100 96 masterKeyBinder_->loadBindings("masterKeybindings.ini"); 101 97 102 // Load the SoundManager103 soundManager_ = new SoundManager();104 105 // Load the InGameConsole106 console_ = new InGameConsole();107 console_->initialise();108 109 98 // add console command to toggle GUI 110 99 this->ccToggleGUI_ = createConsoleCommand(createFunctor(&GSGraphics::toggleGUI, this), "toggleGUI"); … … 131 120 */ 132 121 133 this->console_->destroy();134 135 122 Loader::unload(this->debugOverlay_); 136 123 delete this->debugOverlay_; 137 138 this->soundManager_->destroy();139 124 140 125 // HACK: (destroys a resource smart pointer) … … 170 155 Game::getInstance().requestState("mainMenu"); 171 156 } 172 173 this->console_->update(time);174 157 } 175 158 } -
code/branches/core5/src/orxonox/gamestates/GSGraphics.h
r5842 r5850 60 60 61 61 private: 62 // managed singletons63 InGameConsole* console_;64 SoundManager* soundManager_; //!< Keeps track of SoundBase objects65 66 62 KeyBinder* masterKeyBinder_; //!< Key binder for master key bindings 67 63 InputState* masterInputState_; //!< Special input state for master input -
code/branches/core5/src/orxonox/gamestates/GSLevel.cc
r5842 r5850 41 41 #include "core/Game.h" 42 42 #include "core/GameMode.h" 43 #include "core/GraphicsManager.h"44 43 #include "core/GUIManager.h" 45 44 #include "core/Loader.h" 46 45 #include "core/XMLFile.h" 47 46 48 #include "tools/interfaces/Tickable.h"49 #include "CameraManager.h"50 47 #include "LevelManager.h" 51 48 #include "PlayerManager.h" 52 #include "infos/HumanPlayer.h"53 49 54 50 namespace orxonox … … 65 61 , guiMouseOnlyInputState_(0) 66 62 , guiKeysOnlyInputState_(0) 67 , cameraManager_(0)68 63 { 69 64 RegisterObject(GSLevel); … … 98 93 guiKeysOnlyInputState_ = InputManager::getInstance().createInputState("guiKeysOnly"); 99 94 guiKeysOnlyInputState_->setKeyHandler(GUIManager::getInstancePtr()); 100 101 // create the global CameraManager 102 this->cameraManager_ = new CameraManager(GraphicsManager::getInstance().getViewport()); 103 } 104 105 this->playerManager_ = new PlayerManager(); 106 107 this->scope_GSLevel_ = new Scope<ScopeID::GSLevel>(); 95 } 108 96 109 97 if (GameMode::isMaster()) … … 126 114 127 115 // connect the HumanPlayer to the game 128 this->playerManager_->clientConnected(0);116 PlayerManager::getInstance().clientConnected(0); 129 117 } 130 118 } … … 165 153 { 166 154 // disconnect the HumanPlayer 167 this->playerManager_->clientDisconnected(0);155 PlayerManager::getInstance().clientDisconnected(0); 168 156 169 157 // unload all compositors (this is only necessary because we don't yet destroy all resources!) … … 184 172 if (GameMode::isMaster()) 185 173 this->unloadLevel(); 186 187 if (this->cameraManager_)188 {189 delete this->cameraManager_;190 this->cameraManager_ = 0;191 }192 193 if (this->playerManager_)194 {195 this->playerManager_->destroy();196 this->playerManager_ = 0;197 }198 199 if (this->scope_GSLevel_)200 {201 delete this->scope_GSLevel_;202 this->scope_GSLevel_ = NULL;203 }204 174 205 175 if (GameMode::showsGraphics()) -
code/branches/core5/src/orxonox/gamestates/GSLevel.h
r5842 r5850 33 33 34 34 #include <string> 35 #include "util/Scope.h"36 35 #include "core/OrxonoxClass.h" 37 36 #include "core/GameState.h" … … 67 66 InputState* guiMouseOnlyInputState_; //!< input state if we only need the mouse to use the GUI 68 67 InputState* guiKeysOnlyInputState_; //!< input state if we only need the keys to use the GUI 69 CameraManager* cameraManager_; //!< camera manager for this level70 PlayerManager* playerManager_; //!< player manager for this level71 Scope<ScopeID::GSLevel>* scope_GSLevel_;72 68 73 69 //##### ConfigValues ##### -
code/branches/core5/src/orxonox/gamestates/GSRoot.cc
r5831 r5850 37 37 #include "tools/interfaces/TimeFactorListener.h" 38 38 #include "tools/interfaces/Tickable.h" 39 #include "LevelManager.h"40 39 41 40 namespace orxonox … … 70 69 this->ccPause_ = createConsoleCommand(createFunctor(&GSRoot::pause, this), "pause"); 71 70 CommandExecutor::addConsoleCommandShortcut(this->ccPause_).accessLevel(AccessLevel::Offline); 72 73 // create the LevelManager74 this->levelManager_ = new LevelManager();75 71 } 76 72 … … 90 86 } 91 87 */ 92 93 this->levelManager_->destroy();94 88 } 95 89 -
code/branches/core5/src/orxonox/gamestates/GSRoot.h
r5842 r5850 56 56 float timeFactorPauseBackup_; 57 57 58 LevelManager* levelManager_; //!< global level manager59 60 58 // console commands 61 59 ConsoleCommand* ccSetTimeFactor_;
Note: See TracChangeset
for help on using the changeset viewer.