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)
, cameraTracker(mgr)
, mCurrentPlaylist(NULL)
, mUsingSound(useSound)
{
if(useSound)
{
@ -104,10 +105,13 @@ namespace MWSound
}
SoundManager::~SoundManager()
{
if(mUsingSound)
{
Ogre::Root::getSingleton().removeFrameListener(&updater);
cameraTracker.unfollowCamera();
}
}
// Convert a soundId to file name, and modify the volume
// according to the sounds local volume setting, minRange and

View file

@ -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,