- Timestamp:
- May 17, 2005, 3:22:37 AM (20 years ago)
- Location:
- orxonox/branches/openAL/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/openAL/src/lib/sound/sound_engine.cc
r4206 r4207 190 190 SoundEngine::singletonRef = NULL; 191 191 192 // deleting all the Resources192 // deleting all the SoundSources 193 193 tIterator<SoundSource>* sourceIterator = this->sourceList->getIterator(); 194 194 SoundSource* enumSource = sourceIterator->nextElement(); … … 200 200 delete sourceIterator; 201 201 202 // deleting all the SoundBuffers 202 203 tIterator<SoundBuffer>* bufferIterator = this->bufferList->getIterator(); 203 204 SoundBuffer* enumBuffer = bufferIterator->nextElement(); … … 315 316 316 317 /** 318 \brief Removes all the Buffers that are not anymore needed by any Sources 319 */ 320 void SoundEngine::flushUnusedBuffers(void) 321 { 322 tIterator<SoundBuffer>* bufferIterator = this->bufferList->getIterator(); 323 SoundBuffer* enumBuffer = bufferIterator->nextElement(); 324 while (enumBuffer) 325 { 326 tIterator<SoundSource>* sourceIterator = this->sourceList->getIterator(); 327 SoundSource* enumSource = sourceIterator->nextElement(); 328 while (enumSource) 329 { 330 if (enumBuffer == enumSource->getBuffer()) 331 break; 332 enumSource = sourceIterator->nextElement(); 333 } 334 delete sourceIterator; 335 if (enumSource == NULL) 336 ResourceManager::getInstance()->unload(enumBuffer); 337 enumBuffer = bufferIterator->nextElement(); 338 } 339 delete bufferIterator; 340 } 341 342 /** 317 343 \brief initializes Audio in general 318 344 */ -
orxonox/branches/openAL/src/lib/sound/sound_engine.h
r4206 r4207 51 51 52 52 // development functions 53 /** \returns The ID of the Source */ 54 inline ALuint getID(void) { return this->sourceID; } 53 /** \returns The ID of this Source */ 54 inline ALuint getID(void) const { return this->sourceID; } 55 /** \returns the SoundBuffer of this Source */ 56 inline SoundBuffer* getBuffer(void) const { return this->buffer; } 55 57 /** \returns the SourceNode of this Source */ 56 inline PNode* getNode(void) { return this->sourceNode;}58 inline PNode* getNode(void) const { return this->sourceNode;} 57 59 58 60 void setRolloffFactor(ALfloat rolloffFactor); … … 82 84 void removeSource(SoundSource* source); 83 85 84 85 86 void update(void); 86 87 88 void flushUnusedBuffers(void); 87 89 88 90 // error handling: -
orxonox/branches/openAL/src/orxonox.cc
r4196 r4207 75 75 if( resources != NULL) delete resources; 76 76 delete GraphicsEngine::getInstance(); // deleting the Graphics 77 delete TextEngine::getInstance(); 78 delete SoundEngine::getInstance(); 77 79 delete ResourceManager::getInstance(); // deletes the Resource Manager 78 delete TextEngine::getInstance();79 80 } 80 81
Note: See TracChangeset
for help on using the changeset viewer.