Fix for the --nosound crash

actorid
Michael Papageorgiou 13 years ago
parent af39275a63
commit f567950e25

@ -67,6 +67,7 @@ namespace MWSound
, updater(mgr)
, cameraTracker(mgr)
, mCurrentPlaylist(NULL)
, mUsingSound(useSound)
{
if(useSound)
{
@ -105,8 +106,11 @@ namespace MWSound
SoundManager::~SoundManager()
{
Ogre::Root::getSingleton().removeFrameListener(&updater);
cameraTracker.unfollowCamera();
if(mUsingSound)
{
Ogre::Root::getSingleton().removeFrameListener(&updater);
cameraTracker.unfollowCamera();
}
}
// Convert a soundId to file name, and modify the volume

@ -82,6 +82,8 @@ namespace MWSound
IDMap mLoopedSounds;
bool mUsingSound;
std::string lookup(const std::string &soundId,
float &volume, float &min, float &max);
void add(const std::string &file,

Loading…
Cancel
Save