aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2/sword2.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-09-20 20:31:56 +0000
committerEugene Sandulenko2010-09-20 20:31:56 +0000
commit610686818811f6e4e39589a9631301fa04054f23 (patch)
treed51712d6c9f19949d031021e5d862a7b387367ea /engines/sword2/sword2.cpp
parent723a94099e062408ec9b58d5133f74f37e0988d3 (diff)
downloadscummvm-rg350-610686818811f6e4e39589a9631301fa04054f23.tar.gz
scummvm-rg350-610686818811f6e4e39589a9631301fa04054f23.tar.bz2
scummvm-rg350-610686818811f6e4e39589a9631301fa04054f23.zip
SWORD2: More safeguards for mute setting
svn-id: r52825
Diffstat (limited to 'engines/sword2/sword2.cpp')
-rw-r--r--engines/sword2/sword2.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 58958c509a..b3b688771a 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -326,9 +326,11 @@ void Sword2Engine::registerDefaultSettings() {
}
void Sword2Engine::syncSoundSettings() {
- _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"));
+ bool mute = ConfMan.getBool("mute");
+
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, mute ? 0 : ConfMan.getInt("music_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, mute ? 0 : ConfMan.getInt("speech_volume"));
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, mute ? 0 : ConfMan.getInt("sfx_volume"));
setSubtitles(ConfMan.getBool("subtitles"));
// Our own settings dialog can mute the music, speech and sound effects
@@ -339,7 +341,7 @@ void Sword2Engine::syncSoundSettings() {
ConfMan.setBool("speech_mute", ConfMan.getBool("mute"));
ConfMan.setBool("sfx_mute", ConfMan.getBool("mute"));
- if (!ConfMan.getBool("mute")) // it is false
+ if (!mute) // it is false
// So remove it in order to let individual volumes work
ConfMan.removeKey("mute", ConfMan.getActiveDomainName());
}