diff options
author | Thanasis Antoniou | 2019-04-10 18:59:27 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-04-10 19:00:14 +0300 |
commit | e90f70885248626c96d7643e1c9ad27d6f5f4b78 (patch) | |
tree | 809ab34a2079f3c2b6a1f94cd570438895439814 /engines/bladerunner/bladerunner.cpp | |
parent | c99fbcd53b10261fb193f056ba544df81bb401e3 (diff) | |
download | scummvm-rg350-e90f70885248626c96d7643e1c9ad27d6f5f4b78.tar.gz scummvm-rg350-e90f70885248626c96d7643e1c9ad27d6f5f4b78.tar.bz2 scummvm-rg350-e90f70885248626c96d7643e1c9ad27d6f5f4b78.zip |
BLADERUNNER: Persistent sound settings, speech samples fix
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() { |