From 2cb664178654e4cbe388bd63ae5bdda62b6640ca Mon Sep 17 00:00:00 2001 From: dhewg Date: Sat, 19 Mar 2011 15:07:06 +0100 Subject: SAGA: Cleanup syncSoundSettings() And respect global mute settings --- engines/saga/music.cpp | 3 +++ engines/saga/saga.cpp | 2 ++ engines/saga/sound.cpp | 8 ++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp index dd3034cdb9..f801001d88 100644 --- a/engines/saga/music.cpp +++ b/engines/saga/music.cpp @@ -239,6 +239,9 @@ void Music::setVolume(int volume, int time) { volume = 255; if (time == 1) { + if (ConfMan.hasKey("mute") && ConfMan.getBool("mute")) + volume = 0; + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume); _driver->setVolume(volume); _vm->getTimerManager()->removeTimerProc(&musicVolumeGaugeCallback); diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 2e34b49dc5..62493f5eac 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -625,6 +625,8 @@ GUI::Debugger *SagaEngine::getDebugger() { } void SagaEngine::syncSoundSettings() { + Engine::syncSoundSettings(); + _subtitlesEnabled = ConfMan.getBool("subtitles"); _readingSpeed = getTalkspeed(); diff --git a/engines/saga/sound.cpp b/engines/saga/sound.cpp index 07e8487ee4..8ffce4e6cd 100644 --- a/engines/saga/sound.cpp +++ b/engines/saga/sound.cpp @@ -175,8 +175,12 @@ void Sound::stopAll() { } void Sound::setVolume() { - _vm->_soundVolume = ConfMan.getInt("sfx_volume"); - _vm->_speechVolume = ConfMan.getInt("speech_volume"); + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + + _vm->_soundVolume = mute ? 0 : ConfMan.getInt("sfx_volume"); + _vm->_speechVolume = mute ? 0 : ConfMan.getInt("speech_volume"); _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, _vm->_soundVolume); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, _vm->_speechVolume); } -- cgit v1.2.3