Changeset 3366 for code/branches/resource/src/orxonox/sound
- Timestamp:
- Jul 29, 2009, 10:27:10 PM (15 years ago)
- Location:
- code/branches/resource/src/orxonox/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource/src/orxonox/sound/SoundManager.cc
r3342 r3366 38 38 namespace orxonox 39 39 { 40 SoundManager* SoundManager::singleton Ref_s = NULL;40 SoundManager* SoundManager::singletonPtr_s = NULL; 41 41 42 42 /** … … 45 45 SoundManager::SoundManager() 46 46 { 47 assert(singletonRef_s == NULL);48 singletonRef_s = this;49 50 47 this->device_ = NULL; 51 48 this->soundavailable_ = true; … … 93 90 SoundManager::~SoundManager() 94 91 { 95 assert(singletonRef_s != NULL);96 singletonRef_s = NULL;97 98 92 alcDestroyContext(this->context_); 99 93 alcCloseDevice(this->device_); -
code/branches/resource/src/orxonox/sound/SoundManager.h
r3280 r3366 32 32 #include <cassert> 33 33 #include <list> 34 #include "util/Singleton.h" 34 35 #include "interfaces/Tickable.h" 35 36 … … 42 43 * 43 44 */ 44 class _OrxonoxExport SoundManager : public Tickable45 class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public Tickable 45 46 { 47 friend class Singleton<SoundManager>; 46 48 public: 47 49 SoundManager(); … … 52 54 bool isSoundAvailable(); 53 55 54 static SoundManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }55 56 56 private: 57 57 ALCdevice* device_; … … 60 60 bool soundavailable_; 61 61 62 static SoundManager* singleton Ref_s;62 static SoundManager* singletonPtr_s; 63 63 }; // class SoundManager 64 64 } // namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.