1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00

Update the actual sounds and music volume when settings change

This commit is contained in:
Chris Robinson 2012-05-24 05:30:22 -07:00
parent 6ea7bdb224
commit 05fd8f0211

View File

@ -539,6 +539,30 @@ namespace MWSound
mSFXVolume = Settings::Manager::getFloat("sfx volume", "Sound");
mFootstepsVolume = Settings::Manager::getFloat("footsteps volume", "Sound");
mVoiceVolume = Settings::Manager::getFloat("voice volume", "Sound");
SoundMap::iterator snditer = mActiveSounds.begin();
while(snditer != mActiveSounds.end())
{
if(snditer->second.second != "_say_sound")
{
float basevol = mMasterVolume * mSFXVolume;
float min, max;
lookup(snditer->second.second, basevol, min, max);
snditer->first->mBaseVolume = basevol;
}
else
{
float basevol = mMasterVolume * mVoiceVolume;
snditer->first->mBaseVolume = basevol;
}
snditer->first->update();
snditer++;
}
if(mMusic)
{
mMusic->mBaseVolume = mMasterVolume * mMusicVolume;
mMusic->update();
}
}
// Default readAll implementation, for decoders that can't do anything