From fec6e22cc92358b08d4e0f62e5db18119e5f2e6d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 27 Jan 2008 15:30:53 +0000 Subject: - slightly refactored user settings handling - added user some settings handling for HoF svn-id: r30653 --- engines/kyra/gui_v1.cpp | 93 ------------------------------------------------- 1 file changed, 93 deletions(-) (limited to 'engines/kyra/gui_v1.cpp') diff --git a/engines/kyra/gui_v1.cpp b/engines/kyra/gui_v1.cpp index d51f1e2fee..6c9b822955 100644 --- a/engines/kyra/gui_v1.cpp +++ b/engines/kyra/gui_v1.cpp @@ -37,99 +37,6 @@ namespace Kyra { -void KyraEngine_v1::registerDefaultSettings() { - // Most settings already have sensible defaults. This one, however, is - // specific to the Kyra engine. - ConfMan.registerDefault("walkspeed", 2); - ConfMan.registerDefault("cdaudio", (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)); -} - -void KyraEngine_v1::readSettings() { - int talkspeed = ConfMan.getInt("talkspeed"); - - // The default talk speed is 60. This should be mapped to "Normal". - - if (talkspeed == 0) - _configTextspeed = 3; // Clickable - if (talkspeed <= 50) - _configTextspeed = 0; // Slow - else if (talkspeed <= 150) - _configTextspeed = 1; // Normal - else - _configTextspeed = 2; // Fast - - _configWalkspeed = ConfMan.getInt("walkspeed"); - _configMusic = ConfMan.getBool("music_mute") ? 0 : ((ConfMan.getBool("cdaudio") && (_flags.platform == Common::kPlatformFMTowns || _flags.platform == Common::kPlatformPC98)) ? 2 : 1); - _configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1; - - _sound->enableMusic(_configMusic); - _sound->enableSFX(_configSounds); - - bool speechMute = ConfMan.getBool("speech_mute"); - bool subtitles = ConfMan.getBool("subtitles"); - - if (!speechMute && subtitles) - _configVoice = 2; // Voice & Text - else if (!speechMute && !subtitles) - _configVoice = 1; // Voice only - else - _configVoice = 0; // Text only - - setWalkspeed(_configWalkspeed); -} - -void KyraEngine_v1::writeSettings() { - bool speechMute, subtitles; - int talkspeed; - - switch (_configTextspeed) { - case 0: // Slow - talkspeed = 1; - break; - case 1: // Normal - talkspeed = 60; - break; - case 2: // Fast - talkspeed = 255; - break; - default: // Clickable - talkspeed = 0; - break; - } - - ConfMan.setInt("talkspeed", talkspeed); - ConfMan.setInt("walkspeed", _configWalkspeed); - ConfMan.setBool("music_mute", _configMusic == 0); - ConfMan.setBool("cdaudio", _configMusic == 2); - ConfMan.setBool("sfx_mute", _configSounds == 0); - - switch (_configVoice) { - case 0: // Text only - speechMute = true; - subtitles = true; - break; - case 1: // Voice only - speechMute = false; - subtitles = false; - break; - default: // Voice & Text - speechMute = false; - subtitles = true; - break; - } - - if (!_configMusic) - _sound->beginFadeOut(); - - _sound->enableMusic(_configMusic); - _sound->enableSFX(_configSounds); - - ConfMan.setBool("speech_mute", speechMute); - ConfMan.setBool("subtitles", subtitles); - - ConfMan.flushToDisk(); -} - void KyraEngine_v1::initMainButtonList() { _haveScrollButtons = false; _buttonList = &_buttonData[0]; -- cgit v1.2.3