Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 11, 2011, 4:05:55 PM (13 years ago)
Author:
landauf
Message:

fixed (?) an endless loop in SoundManager::preUpdate if a non-looping ambient sound faded out. maybe solved the problem by returning a bool from stop() depending on whether or not the sound source was destroyed.

someone who knows more about the sound system should probably have a look at this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/sound/SoundManager.cc

    r7855 r7856  
    241241            if (state == AL_STOPPED)
    242242            {
    243                 this->usedSoundSources_[i].second->stop();
    244                 --i;
     243                if (this->usedSoundSources_[i].second->stop()) // if stop() returns true, the sound source was removed, thus decrement the array index
     244                    --i;
    245245            }
    246246        }
Note: See TracChangeset for help on using the changeset viewer.