Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2009, 12:51:34 AM (15 years ago)
Author:
rgrieder
Message:

Overriding preDestroy() in AmbientSound to make them fade out when the level unloads.
@Kevin: this should also prevent the random bug you showed me when reloading a level with ambient sound.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.cc

    r6326 r6349  
    5353    AmbientSound::~AmbientSound()
    5454    {
     55    }
     56
     57    void AmbientSound::preDestroy()
     58    {
     59        if (GameMode::playsSound())
     60        {
     61            // Smoothly fade out by keeping a SmartPtr
     62            SoundManager::getInstance().unregisterAmbientSound(this);
     63        }
    5564    }
    5665   
Note: See TracChangeset for help on using the changeset viewer.