diff options
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/audio_speech.cpp | 13 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.cpp | 30 | ||||
-rw-r--r-- | engines/bladerunner/bladerunner.h | 2 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_settings.cpp | 12 |
4 files changed, 47 insertions, 10 deletions
diff --git a/engines/bladerunner/audio_speech.cpp b/engines/bladerunner/audio_speech.cpp index 2370a7b1d3..8d2f18dbb6 100644 --- a/engines/bladerunner/audio_speech.cpp +++ b/engines/bladerunner/audio_speech.cpp @@ -32,7 +32,9 @@ namespace BladeRunner { -const int AudioSpeech::kSpeechSamples[] = { 65, 355, 490, 465, 480, 485, 505, 760, 7655, 7770, 7740, 8170, 2705, 7200, 6460, 5560, 4870, 4555, 3880, 3525, 3595, 3250, 3070 }; +// Note: Speech samples here should be from A.TLK file +const int kSpeechSamplesNumber = 23; +const int AudioSpeech::kSpeechSamples[kSpeechSamplesNumber] = { 65, 355, 490, 465, 480, 485, 505, 760, 7655, 7770, 7740, 8170, 2705, 7200, 6460, 5560, 4870, 4555, 3880, 3525, 3595, 3250, 3070 }; void AudioSpeech::ended() { //Common::StackLock lock(_mutex); @@ -138,7 +140,14 @@ int AudioSpeech::getVolume() const { } void AudioSpeech::playSample() { - _vm->_playerActor->speechPlay(kSpeechSamples[_vm->_rnd.getRandomNumber(22)], true); +#if BLADERUNNER_ORIGINAL_BUGS + _vm->_playerActor->speechPlay(kSpeechSamples[_vm->_rnd.getRandomNumber(kSpeechSamplesNumber-1)], true); +#else + if (_vm->openArchive("A.TLK")) { + // load sample speech even when in initial KIA screen (upon launch - but before loading a game) + _vm->_playerActor->speechPlay(kSpeechSamples[_vm->_rnd.getRandomNumber(kSpeechSamplesNumber-1)], true); + } +#endif // BLADERUNNER_ORIGINAL_BUGS } } // End of namespace BladeRunner 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() { diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h index ef5140d522..c3e53eb7a5 100644 --- a/engines/bladerunner/bladerunner.h +++ b/engines/bladerunner/bladerunner.h @@ -200,7 +200,7 @@ public: bool _sceneIsLoading; bool _vqaIsPlaying; bool _vqaStopIsRequested; - bool _subtitlesEnabled; // tracks the state of whether subtitles are enabled or disabled from ScummVM GUI option or KIA checkbox (the states are synched) + bool _subtitlesEnabled; // tracks the state of whether subtitles are enabled or disabled from ScummVM GUI option or KIA checkbox (the states are synched) bool _sitcomMode; bool _shortyMode; diff --git a/engines/bladerunner/ui/kia_section_settings.cpp b/engines/bladerunner/ui/kia_section_settings.cpp index 288e0b48a3..24c24acced 100644 --- a/engines/bladerunner/ui/kia_section_settings.cpp +++ b/engines/bladerunner/ui/kia_section_settings.cpp @@ -289,17 +289,17 @@ void KIASectionSettings::sliderCallback(void *callbackData, void *source) { } #else if (source == self->_musicVolume) { - self->_vm->_mixer->setVolumeForSoundType(self->_vm->_mixer->kMusicSoundType, self->_musicVolume->_value); - self->_vm->_music->playSample(); ConfMan.setInt("music_volume", self->_musicVolume->_value); + self->_vm->syncSoundSettings(); + self->_vm->_music->playSample(); } else if (source == self->_soundEffectVolume) { - self->_vm->_mixer->setVolumeForSoundType(self->_vm->_mixer->kSFXSoundType, self->_soundEffectVolume->_value); - self->_vm->_audioPlayer->playSample(); ConfMan.setInt("sfx_volume", self->_soundEffectVolume->_value); + self->_vm->syncSoundSettings(); + self->_vm->_audioPlayer->playSample(); } else if (source == self->_speechVolume) { - self->_vm->_mixer->setVolumeForSoundType(self->_vm->_mixer->kSpeechSoundType, self->_speechVolume->_value); - self->_vm->_audioSpeech->playSample(); ConfMan.setInt("speech_volume", self->_speechVolume->_value); + self->_vm->syncSoundSettings(); + self->_vm->_audioSpeech->playSample(); } #endif } |