Fix for the --nosound crash

This commit is contained in:
Michael Papageorgiou 2012-03-18 22:38:53 +02:00
parent af39275a63
commit f567950e25
2 changed files with 8 additions and 2 deletions

View file

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

View file

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