Changeset 3184 for code/branches/pch
- Timestamp:
- Jun 15, 2009, 11:45:29 PM (15 years ago)
- Location:
- code/branches/pch/src/orxonox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/orxonox/gamestates/GSGraphics.cc
r3182 r3184 52 52 #include "overlays/console/InGameConsole.h" 53 53 #include "gui/GUIManager.h" 54 #include "sound/SoundManager.h" 54 55 #include "GraphicsManager.h" 55 56 … … 64 65 , guiManager_(0) 65 66 , graphicsManager_(0) 67 , soundManager_(0) 66 68 , masterKeyBinder_(0) 67 69 , masterInputState_(0) … … 95 97 \li creates input manager 96 98 \li loads master key bindings 99 \li loads the SoundManager 97 100 \li loads ingame console 98 101 \li loads GUI interface (GUIManager) … … 128 131 masterKeyBinder_->loadBindings("masterKeybindings.ini"); 129 132 masterInputState_->setKeyHandler(masterKeyBinder_); 133 134 // Load the SoundManager 135 soundManager_ = new SoundManager(); 130 136 131 137 // Load the InGameConsole … … 173 179 delete this->debugOverlay_; 174 180 181 delete this->soundManager_; 182 175 183 delete this->inputManager_; 176 184 this->inputManager_ = 0; -
code/branches/pch/src/orxonox/gamestates/GSGraphics.h
r3177 r3184 72 72 GUIManager* guiManager_; //!< Interface to GUI 73 73 GraphicsManager* graphicsManager_; //!< Interface to Ogre 74 SoundManager* soundManager_; //!< Keeps track of SoundBase objects 74 75 75 76 KeyBinder* masterKeyBinder_; //!< Key binder for master key bindings -
code/branches/pch/src/orxonox/sound/SoundBase.cc
r3157 r3184 41 41 namespace orxonox 42 42 { 43 SoundManager* SoundBase::soundmanager_s = NULL;44 45 43 SoundBase::SoundBase(WorldEntity* entity) 46 44 { 47 if(SoundBase::soundmanager_s == NULL)48 {49 SoundBase::soundmanager_s = new SoundManager();50 }51 52 45 this->source_ = 0; 53 46 this->buffer_ = 0; 54 47 this->entity_ = entity; 55 48 56 Sound Base::soundmanager_s->addSound(this);49 SoundManager::getInstance().addSound(this); 57 50 } 58 51 … … 144 137 filename = Core::getMediaPathString() + "/audio/" + filename; 145 138 146 if(!Sound Base::soundmanager_s->isSoundAvailable())139 if(!SoundManager::getInstance().isSoundAvailable()) 147 140 { 148 141 COUT(3) << "Sound: not available, skipping " << filename << std::endl; -
code/branches/pch/src/orxonox/sound/SoundBase.h
r3167 r3184 64 64 65 65 ALint getSourceState(); 66 67 static SoundManager* soundmanager_s;68 66 }; // class SoundBase 69 67 } // namepsace orxonox -
code/branches/pch/src/orxonox/sound/SoundManager.cc
r3133 r3184 38 38 namespace orxonox 39 39 { 40 SoundManager* SoundManager::singletonRef_s = NULL; 40 41 ALCdevice* SoundManager::device_s = NULL; 41 42 … … 45 46 SoundManager::SoundManager() 46 47 { 48 assert(singletonRef_s == NULL); 49 singletonRef_s = this; 50 47 51 this->soundavailable_ = true; 48 52 if(!alutInitWithoutContext(NULL,NULL)) … … 91 95 SoundManager::~SoundManager() 92 96 { 97 assert(singletonRef_s != NULL); 98 singletonRef_s = NULL; 99 93 100 alcDestroyContext(this->context_); 94 101 alcCloseDevice(SoundManager::device_s); -
code/branches/pch/src/orxonox/sound/SoundManager.h
r3177 r3184 30 30 #include "OrxonoxPrereqs.h" 31 31 32 #include <cassert> 32 33 #include <list> 33 34 #include "interfaces/Tickable.h" … … 51 52 bool isSoundAvailable(); 52 53 54 static SoundManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 55 53 56 private: 54 57 static ALCdevice* device_s; … … 57 60 bool soundavailable_; 58 61 62 static SoundManager* singletonRef_s; 59 63 }; // class SoundManager 60 64 } // namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.