diff options
author | Torbjörn Andersson | 2010-07-23 19:52:58 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2010-07-23 19:52:58 +0000 |
commit | cc6f4f4cdc1acd407cccd061e73b0ddb63f4b5ab (patch) | |
tree | f0c728398eaace312cdbda924402963fc6c1b21b | |
parent | d6695e180cfedb723a670d94d8ed132ed896498d (diff) | |
download | scummvm-rg350-cc6f4f4cdc1acd407cccd061e73b0ddb63f4b5ab.tar.gz scummvm-rg350-cc6f4f4cdc1acd407cccd061e73b0ddb63f4b5ab.tar.bz2 scummvm-rg350-cc6f4f4cdc1acd407cccd061e73b0ddb63f4b5ab.zip |
SWORD2: Improve sync between local and global "mute" settings
Broken Sword 2's options dialog allows you to mute any of speech, sound
and sound effects, whereas ScummVM's options dialog just has one
"master" mute setting. This is an attempt to keep them better in sync,
though it's not perfect. Still, it may be good enough to fix bug
#3032763 ("SWORD2: Mute setting does not work").
svn-id: r51218
-rw-r--r-- | engines/sword2/sword2.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 1060dcf728..3cdab2bd2b 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -326,12 +326,20 @@ void Sword2Engine::registerDefaultSettings() { } void Sword2Engine::syncSoundSettings() { - // Sound settings. At the time of writing, not all of these can be set - // by the global options dialog, but it seems silly to split them up. _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); setSubtitles(ConfMan.getBool("subtitles")); + + // Our own settings dialog can mute the music, speech and sound effects + // individually. ScummVM's settings dialog has one master mute setting. + + if (ConfMan.getBool("mute")) { + ConfMan.setBool("music_mute", true); + ConfMan.setBool("speech_mute", true); + ConfMan.setBool("sfx_mute", true); + } + _sound->muteMusic(ConfMan.getBool("music_mute")); _sound->muteSpeech(ConfMan.getBool("speech_mute")); _sound->muteFx(ConfMan.getBool("sfx_mute")); @@ -356,6 +364,13 @@ void Sword2Engine::writeSettings() { ConfMan.setBool("object_labels", _mouse->getObjectLabels()); ConfMan.setInt("reverse_stereo", _sound->isReverseStereo()); + // If even one sound type is unmuted, we can't say that all sound is + // muted. + + if (!_sound->isMusicMute() || !_sound->isSpeechMute() || !_sound->isFxMute()) { + ConfMan.setBool("mute", false); + } + ConfMan.flushToDisk(); } |