Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2009, 12:51:34 AM (14 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/SoundManager.h

    r6332 r6349  
    4040#include "util/Singleton.h"
    4141#include "core/OrxonoxClass.h"
     42#include "core/SmartPtr.h"
    4243
    4344// forward declaration
     
    109110    private:
    110111        void processCrossFading(float dt);
    111         void fadeIn(AmbientSound* sound);
    112         void fadeOut(AmbientSound* sound);
     112        void fadeIn(const SmartPtr<AmbientSound>& sound);
     113        void fadeOut(const SmartPtr<AmbientSound>& sound);
    113114
    114115        void checkFadeStepValidity();
     
    133134
    134135        float crossFadeStep_;       //!< Absolute change per second (0.1 means 10% of the nominal volume) for cross fading
    135         std::list<AmbientSound*> fadeInList_;
    136         std::list<AmbientSound*> fadeOutList_;
     136        std::list<SmartPtr<AmbientSound> > fadeInList_;
     137        std::list<SmartPtr<AmbientSound> > fadeOutList_;
    137138
    138139        float soundVolume_;
Note: See TracChangeset for help on using the changeset viewer.