diff options
Diffstat (limited to 'engines/bladerunner/bladerunner.cpp')
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 64b42e0204..2bf358db4c 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -108,6 +108,7 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des _actorSpeakStopIsRequested = false; _subtitlesEnabled = false; + _sitcomMode = false; _shortyMode = false; @@ -431,8 +432,14 @@ bool BladeRunnerEngine::startup(bool hasSavegames) { // Assign default values to the ScummVM configuration manager, in case settings are missing ConfMan.registerDefault("subtitles", "true"); + ConfMan.registerDefault("sfx_volume", 192); + ConfMan.registerDefault("music_volume", 192); + ConfMan.registerDefault("speech_volume", 192); + ConfMan.registerDefault("mute", "false"); + ConfMan.registerDefault("speech_mute", "false"); + // get value from the ScummVM configuration manager - _subtitlesEnabled = ConfMan.getBool("subtitles"); + syncSoundSettings(); _sitcomMode = ConfMan.getBool("sitcom"); _shortyMode = ConfMan.getBool("shorty"); @@ -1769,6 +1776,27 @@ void BladeRunnerEngine::syncSoundSettings() { Engine::syncSoundSettings(); _subtitlesEnabled = ConfMan.getBool("subtitles"); + + _mixer->setVolumeForSoundType(_mixer->kMusicSoundType, ConfMan.getInt("music_volume")); + _mixer->setVolumeForSoundType(_mixer->kSFXSoundType, ConfMan.getInt("sfx_volume")); + _mixer->setVolumeForSoundType(_mixer->kSpeechSoundType, ConfMan.getInt("speech_volume")); + + // debug("syncSoundSettings: Volumes synced as Music: %d, Sfx: %d, Speech: %d", ConfMan.getInt("music_volume"), ConfMan.getInt("sfx_volume"), ConfMan.getInt("speech_volume")); + + if (ConfMan.hasKey("mute")) { + _mixer->muteSoundType(_mixer->kMusicSoundType, ConfMan.getBool("mute")); + _mixer->muteSoundType(_mixer->kSFXSoundType, ConfMan.getBool("mute")); + _mixer->muteSoundType(_mixer->kSpeechSoundType, ConfMan.getBool("mute")); + } + + if (ConfMan.hasKey("speech_mute")) { + // if true it means show only subtitles + // "subtitles" key will already be set appropriately by Engine::syncSoundSettings(); + // but we need to mute the speech + _mixer->muteSoundType(_mixer->kSpeechSoundType, ConfMan.getBool("speech_mute")); + } + // write-back to ini file for persistence + ConfMan.flushToDisk(); // TODO Or maybe call this only when game is shut down? } bool BladeRunnerEngine::isSubtitlesEnabled() { |