diff options
author | Paul Gilbert | 2011-06-21 21:42:42 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-06-21 21:42:42 +1000 |
commit | 8aa368fe559bd19aedbbc7353b784466a0381485 (patch) | |
tree | 949690bcd4ce7696511dffa2970de1a68e27a282 /engines/tsage/sound.cpp | |
parent | 8c6ad70158ecdf75dd4f9e405f6afcee6dfcb982 (diff) | |
download | scummvm-rg350-8aa368fe559bd19aedbbc7353b784466a0381485.tar.gz scummvm-rg350-8aa368fe559bd19aedbbc7353b784466a0381485.tar.bz2 scummvm-rg350-8aa368fe559bd19aedbbc7353b784466a0381485.zip |
TSAGE: Fix updating the volume when changed in the Options dialog
Diffstat (limited to 'engines/tsage/sound.cpp')
-rw-r--r-- | engines/tsage/sound.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/tsage/sound.cpp b/engines/tsage/sound.cpp index 811e272086..c2e5ba716f 100644 --- a/engines/tsage/sound.cpp +++ b/engines/tsage/sound.cpp @@ -43,7 +43,7 @@ SoundManager::SoundManager() { _voiceTypeStructPtrs[i] = NULL; _groupsAvail = 0; - _masterVol = 127; + _newVolume = _masterVol = 127; _suspendedCount = 0; _driversDetected = false; _needToRethink = false; @@ -100,18 +100,14 @@ void SoundManager::syncSounds() { mute = ConfMan.getBool("mute"); bool music_mute = mute; - bool sfx_mute = mute; if (!mute) { music_mute = ConfMan.getBool("music_mute"); - sfx_mute = ConfMan.getBool("sfx_mute"); } - // Get the new music and sfx volumes + // Get the new music volume int musicVolume = music_mute ? 0 : MIN(255, ConfMan.getInt("music_volume")); - int sfxVolume = sfx_mute ? 0 : MIN(255, ConfMan.getInt("sfx_volume")); - warning("Set volume music=%d sfx=%d", musicVolume, sfxVolume); this->setMasterVol(musicVolume / 2); } @@ -251,7 +247,7 @@ bool SoundManager::isInstalled(int driverNum) const { } void SoundManager::setMasterVol(int volume) { - _sfSetMasterVol(volume); + _newVolume = volume; } int SoundManager::getMasterVol() const { @@ -341,6 +337,10 @@ void SoundManager::_sfSoundServer() { _sfDereferenceAll(); } + // If the master volume has changed, update it + if (sfManager()._newVolume != sfManager()._masterVol) + _sfSetMasterVol(sfManager()._newVolume); + // Handle any fading if necessary _sfProcessFading(); |