Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4219 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
May 18, 2005, 2:15:48 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/openAL: audio Buffers will be flushed at the End of the Level

Location:
orxonox/branches/openAL/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/openAL/src/lib/sound/sound_engine.cc

    r4209 r4219  
    264264void SoundEngine::removeBuffer(SoundBuffer* buffer)
    265265{
     266  // look if there are any sources that have the buffer still loaded
     267  tIterator<SoundSource>* sourceIterator = this->sourceList->getIterator();
     268  SoundSource* enumSource = sourceIterator->nextElement();
     269  while (enumSource)
     270    {
     271      if (buffer == enumSource->getBuffer())
     272        delete enumSource;
     273      enumSource = sourceIterator->nextElement();
     274    }
     275  delete sourceIterator;
     276
     277  // remove the Buffer
    266278  this->bufferList->remove(buffer);
    267279}
     
    357369
    358370/**
     371   \brief SourceEngine::flushAllBuffers
     372*/
     373void SoundEngine::flushAllBuffers(void)
     374{
     375    tIterator<SoundBuffer>* bufferIterator = this->bufferList->getIterator();
     376  SoundBuffer* enumBuffer = bufferIterator->nextElement();
     377  while (enumBuffer)
     378    {
     379      ResourceManager::getInstance()->unload(enumBuffer, RP_LEVEL);
     380      enumBuffer = bufferIterator->nextElement();
     381    }
     382  delete bufferIterator;
     383}
     384
     385/**
    359386   \brief initializes Audio in general
    360387*/
  • orxonox/branches/openAL/src/lib/sound/sound_engine.h

    r4210 r4219  
    8989  // administrative
    9090  void flushUnusedBuffers(void);
     91  void flushAllBuffers(void);
    9192  bool initAudio(void);
    9293
  • orxonox/branches/openAL/src/story_entities/world.cc

    r4209 r4219  
    208208  delete this->particleEngine;
    209209  TextEngine::getInstance()->flush();
     210  SoundEngine::getInstance()->flushAllBuffers();
    210211
    211212  delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence.
Note: See TracChangeset for help on using the changeset viewer.