From eaca27a33bb5bc68fae8a58b32f2cec94aabb5fb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 29 Apr 2006 23:09:40 +0000 Subject: Renamed updateVolumes to updateSoundSettings -- now it also handles subtitles/speech_mute settings. Also changed the ConfigDialog accordingly svn-id: r22233 --- engines/scumm/dialogs.cpp | 13 +------------ engines/scumm/input.cpp | 2 +- engines/scumm/saveload.cpp | 2 +- engines/scumm/scumm.cpp | 15 ++++++++++++--- engines/scumm/scumm.h | 2 +- 5 files changed, 16 insertions(+), 18 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index cab98503f6..c44c8cfa2d 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -733,18 +733,7 @@ void ConfigDialog::close() { if (getResult()) { // Subtitles ConfMan.setBool("subtitles", _subtitlesCheckbox->getState(), _domain); - - // Sync with current setting - if (!_speechCheckbox->getState()) { - ConfMan.setBool("speech_mute", true, _domain); - _vm->_voiceMode = 2; - } else { - ConfMan.setBool("speech_mute", false, _domain); - _vm->_voiceMode = _subtitlesCheckbox->getState(); - } - - if (_vm->_game.version >= 7) - _vm->VAR(_vm->VAR_VOICE_MODE) = _vm->_voiceMode; + ConfMan.setBool("speech_mute", !_speechCheckbox->getState(), _domain); } GUI_OptionsDialog::close(); diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index 760482c183..2cc361cbb4 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -435,7 +435,7 @@ void ScummEngine::processKbd(bool smushMode) { vol = Audio::Mixer::kMaxMixerVolume; ConfMan.setInt("music_volume", vol); - updateVolumes(); + updateSoundSettings(); } else if (_lastKeyHit == '-' || _lastKeyHit == '+') { // Change text speed if (_lastKeyHit == '+' && _defaultTalkDelay > 0) _defaultTalkDelay--; diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp index dc13319c2b..98ef6a3694 100644 --- a/engines/scumm/saveload.cpp +++ b/engines/scumm/saveload.cpp @@ -270,7 +270,7 @@ bool ScummEngine::loadState(int slot, bool compat) { delete in; // Update volume settings - updateVolumes(); + updateSoundSettings(); // Init NES costume data if (_game.platform == Common::kPlatformNES) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index b98d47e391..ee7ea1af9c 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1471,10 +1471,10 @@ void ScummEngine::setupMusic(int midi) { } } - updateVolumes(); + updateSoundSettings(); } -void ScummEngine::updateVolumes() { +void ScummEngine::updateSoundSettings() { // Sync the engine with the config manager int soundVolumeMusic = ConfMan.getInt("music_volume"); @@ -1488,6 +1488,15 @@ void ScummEngine::updateVolumes() { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSfx); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); + + + if (ConfMan.getBool("speech_mute")) + _voiceMode = 2; + else + _voiceMode = ConfMan.getBool("subtitles"); + + if (VAR_VOICE_MODE != 0xFF) + VAR(VAR_VOICE_MODE) = _voiceMode; } @@ -2059,7 +2068,7 @@ void ScummEngine::mainMenuDialog() { if (!_mainMenuDialog) _mainMenuDialog = new MainMenuDialog(this); runDialog(*_mainMenuDialog); - updateVolumes(); + updateSoundSettings(); } void ScummEngine::confirmExitDialog() { diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index e5833ca109..3b19795dc6 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -469,7 +469,7 @@ protected: virtual void loadLanguageBundle() {} void loadCJKFont(); void setupMusic(int midi); - void updateVolumes(); + void updateSoundSettings(); protected: // Scumm main loop & helper functions. -- cgit v1.2.3