Changeset 3370 for code/trunk/src/orxonox/sound
- Timestamp:
- Jul 30, 2009, 2:10:44 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/resource (added) merged: 3328,3336-3340,3342-3350,3352-3366
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/sound/SoundBase.cc
r3196 r3370 65 65 void SoundBase::update() { 66 66 if(this->entity_ != NULL && alIsSource(this->source_)) { 67 Vector3pos = this->entity_->getPosition();67 const Vector3& pos = this->entity_->getPosition(); 68 68 alSource3f(this->source_, AL_POSITION, pos.x, pos.y, pos.z); 69 69 ALenum error = alGetError(); … … 71 71 COUT(2) << "Sound: OpenAL: Invalid sound position" << std::endl; 72 72 73 Vector3vel = this->entity_->getVelocity();73 const Vector3& vel = this->entity_->getVelocity(); 74 74 alSource3f(this->source_, AL_VELOCITY, vel.x, vel.y, vel.z); 75 75 error = alGetError(); … … 77 77 COUT(2) << "Sound: OpenAL: Invalid sound velocity" << std::endl; 78 78 79 Quaternionorient = this->entity_->getOrientation();79 const Quaternion& orient = this->entity_->getOrientation(); 80 80 Vector3 at = orient.zAxis(); 81 81 alSource3f(this->source_, AL_DIRECTION, at.x, at.y, at.z); … … 190 190 if(ov_open(f, &vf, NULL, 0) < 0) 191 191 { 192 COUT(2) << "Sound: libvorbisfile: File seems notto be an Ogg Vorbis bitstream" << std::endl;192 COUT(2) << "Sound: libvorbisfile: File does not seem to be an Ogg Vorbis bitstream" << std::endl; 193 193 ov_clear(&vf); 194 194 return AL_NONE; -
code/trunk/src/orxonox/sound/SoundManager.cc
r3280 r3370 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_); … … 148 142 149 143 // update listener orientation 150 Quaternionorient = camera->getOrientation();144 const Quaternion& orient = camera->getOrientation(); 151 145 Vector3 up = orient.xAxis(); // just a wild guess 152 146 Vector3 at = orient.zAxis(); -
code/trunk/src/orxonox/sound/SoundManager.h
r3280 r3370 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.