Changeset 5850 for code/branches/core5/src/orxonox
- Timestamp:
- Oct 1, 2009, 11:44:53 AM (15 years ago)
- Location:
- code/branches/core5/src/orxonox
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/CameraManager.cc
r5805 r5850 34 34 #include "util/StringUtils.h" 35 35 #include "core/GameMode.h" 36 #include "core/GraphicsManager.h" 36 37 #include "core/GUIManager.h" 37 38 #include "core/ObjectList.h" … … 44 45 CameraManager* CameraManager::singletonPtr_s = 0; 45 46 46 CameraManager::CameraManager( Ogre::Viewport* viewport)47 : viewport_( viewport)47 CameraManager::CameraManager() 48 : viewport_(GraphicsManager::getInstance().getViewport()) 48 49 { 49 50 this->fallbackCamera_ = 0; -
code/branches/core5/src/orxonox/CameraManager.h
r5805 r5850 41 41 #include <list> 42 42 #include "util/OgreForwardRefs.h" 43 #include "util/Singleton.h" 43 #include "util/ScopedSingleton.h" 44 #include "core/OrxonoxClass.h" 44 45 #include "core/SmartPtr.h" 45 46 46 47 namespace orxonox 47 48 { 48 class _OrxonoxExport CameraManager : public S ingleton<CameraManager>49 class _OrxonoxExport CameraManager : public ScopedSingleton<CameraManager, ScopeID::Graphics>, public OrxonoxClass 49 50 { 50 friend class S ingleton<CameraManager>;51 friend class ScopedSingleton<CameraManager, ScopeID::Graphics>; 51 52 public: 52 CameraManager( Ogre::Viewport* viewport);53 CameraManager(); 53 54 ~CameraManager(); 54 55 -
code/branches/core5/src/orxonox/LevelManager.h
r3370 r5850 36 36 #include <string> 37 37 38 #include "util/S ingleton.h"38 #include "util/ScopedSingleton.h" 39 39 #include "core/OrxonoxClass.h" 40 40 … … 44 44 class _OrxonoxExport LevelManager 45 45 // tolua_end 46 : public S ingleton<LevelManager>, public OrxonoxClass46 : public ScopedSingleton<LevelManager, ScopeID::Root>, public OrxonoxClass 47 47 { // tolua_export 48 friend class S ingleton<LevelManager>;48 friend class ScopedSingleton<LevelManager, ScopeID::Root>; 49 49 public: 50 50 LevelManager(); … … 63 63 64 64 static LevelManager* getInstancePtr() { return singletonPtr_s; } 65 static LevelManager& getInstance() { return S ingleton<LevelManager>::getInstance(); } // tolua_export65 static LevelManager& getInstance() { return ScopedSingleton<LevelManager, ScopeID::Root>::getInstance(); } // tolua_export 66 66 67 67 private: -
code/branches/core5/src/orxonox/PlayerManager.h
r5820 r5850 34 34 #include <cassert> 35 35 #include <map> 36 #include "util/S ingleton.h"36 #include "util/ScopedSingleton.h" 37 37 #include "network/ClientConnectionListener.h" 38 38 39 39 namespace orxonox 40 40 { 41 class _OrxonoxExport PlayerManager : public S ingleton<PlayerManager>, public ClientConnectionListener41 class _OrxonoxExport PlayerManager : public ScopedSingleton<PlayerManager, ScopeID::Root>, public ClientConnectionListener 42 42 { 43 friend class S ingleton<PlayerManager>;43 friend class ScopedSingleton<PlayerManager, ScopeID::Root>; 44 44 public: 45 45 PlayerManager(); -
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_; -
code/branches/core5/src/orxonox/overlays/InGameConsole.cc
r5738 r5850 85 85 86 86 this->setConfigValues(); 87 this->initialise(); 87 88 } 88 89 -
code/branches/core5/src/orxonox/overlays/InGameConsole.h
r5791 r5850 36 36 37 37 #include "util/OgreForwardRefs.h" 38 #include "util/S ingleton.h"38 #include "util/ScopedSingleton.h" 39 39 #include "core/Shell.h" 40 40 #include "core/WindowEventListener.h" … … 42 42 namespace orxonox 43 43 { 44 class _OrxonoxExport InGameConsole : public S ingleton<InGameConsole>, public ShellListener, public WindowEventListener44 class _OrxonoxExport InGameConsole : public ScopedSingleton<InGameConsole, ScopeID::Graphics>, public ShellListener, public WindowEventListener 45 45 { 46 friend class S ingleton<InGameConsole>;46 friend class ScopedSingleton<InGameConsole, ScopeID::Graphics>; 47 47 public: // functions 48 48 InGameConsole(); -
code/branches/core5/src/orxonox/sound/SoundManager.h
r5693 r5850 32 32 #include <cassert> 33 33 #include <list> 34 #include "util/S ingleton.h"34 #include "util/ScopedSingleton.h" 35 35 #include "tools/interfaces/Tickable.h" 36 36 … … 43 43 * 44 44 */ 45 class _OrxonoxExport SoundManager : public S ingleton<SoundManager>, public Tickable45 class _OrxonoxExport SoundManager : public ScopedSingleton<SoundManager, ScopeID::Graphics>, public Tickable 46 46 { 47 friend class S ingleton<SoundManager>;47 friend class ScopedSingleton<SoundManager, ScopeID::Graphics>; 48 48 public: 49 49 SoundManager();
Note: See TracChangeset
for help on using the changeset viewer.