diff options
author | Max Horn | 2006-04-16 19:23:14 +0000 |
---|---|---|
committer | Max Horn | 2006-04-16 19:23:14 +0000 |
commit | 74edd90aba15db1196b16b5eae918347670d11c8 (patch) | |
tree | 7410c4e14dadff2c051b42ea3a09d99987b0d6d5 /engines | |
parent | 08b9cd7922c48df064c17d71cc306f330043b817 (diff) | |
download | scummvm-rg350-74edd90aba15db1196b16b5eae918347670d11c8.tar.gz scummvm-rg350-74edd90aba15db1196b16b5eae918347670d11c8.tar.bz2 scummvm-rg350-74edd90aba15db1196b16b5eae918347670d11c8.zip |
Fix for bug #1471383: Instead of overloading ConfigManager::set, we now have new setInt and setBool methods (matching getInt/getBool), which avoids strange quirks & bugs caused by (char *) being implicitly cast to int (ouch)
svn-id: r21951
Diffstat (limited to 'engines')
-rw-r--r-- | engines/queen/queen.cpp | 12 | ||||
-rw-r--r-- | engines/saga/interface.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/dialogs.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/he/script_v70he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/he/script_v72he.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/input.cpp | 14 | ||||
-rw-r--r-- | engines/scumm/script.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/script_v6.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 4 | ||||
-rw-r--r-- | engines/sky/control.cpp | 6 | ||||
-rw-r--r-- | engines/sword2/sword2.cpp | 20 |
11 files changed, 40 insertions, 40 deletions
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index c87ccd6695..611832c439 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -194,12 +194,12 @@ void QueenEngine::readOptionSettings() { } void QueenEngine::writeOptionSettings() { - ConfMan.set("music_volume", _music->volume()); - ConfMan.set("music_mute", !_sound->musicOn()); - ConfMan.set("sfx_mute", !_sound->sfxOn()); - ConfMan.set("talkspeed", _talkSpeed); - ConfMan.set("speech_mute", !_sound->speechOn()); - ConfMan.set("subtitles", _subtitles); + ConfMan.setInt("music_volume", _music->volume()); + ConfMan.setBool("music_mute", !_sound->musicOn()); + ConfMan.setBool("sfx_mute", !_sound->sfxOn()); + ConfMan.setInt("talkspeed", _talkSpeed); + ConfMan.setBool("speech_mute", !_sound->speechOn()); + ConfMan.setBool("subtitles", _subtitles); ConfMan.flushToDisk(); } diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp index 1d3b110068..e1d01507e0 100644 --- a/engines/saga/interface.cpp +++ b/engines/saga/interface.cpp @@ -1364,21 +1364,21 @@ void Interface::setOption(PanelButton *panelButton) { case kTextReadingSpeed: if (_vm->getFeatures() & GF_CD_FX) { _vm->_subtitlesEnabled = !_vm->_subtitlesEnabled; - ConfMan.set("subtitles", _vm->_subtitlesEnabled); + ConfMan.setBool("subtitles", _vm->_subtitlesEnabled); } else { _vm->_readingSpeed = (_vm->_readingSpeed + 1) % 4; - ConfMan.set("talkspeed", _vm->_readingSpeed); + ConfMan.setInt("talkspeed", _vm->_readingSpeed); } break; case kTextMusic: _vm->_musicVolume = (_vm->_musicVolume + 1) % 11; _vm->_music->setVolume(_vm->_musicVolume == 10 ? -1 : _vm->_musicVolume * 25, 1); - ConfMan.set("music_volume", _vm->_musicVolume * 25); + ConfMan.setInt("music_volume", _vm->_musicVolume * 25); break; case kTextSound: _vm->_soundVolume = (_vm->_soundVolume + 1) % 11; _vm->_sound->setVolume(_vm->_soundVolume == 10 ? 255 : _vm->_soundVolume * 25); - ConfMan.set("sfx_volume", _vm->_soundVolume * 25); + ConfMan.setInt("sfx_volume", _vm->_soundVolume * 25); break; } } diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 333e702944..6cc6224bfa 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -719,14 +719,14 @@ void ConfigDialog::open() { void ConfigDialog::close() { if (getResult()) { // Subtitles - ConfMan.set("subtitles", _subtitlesCheckbox->getState(), _domain); + ConfMan.setBool("subtitles", _subtitlesCheckbox->getState(), _domain); // Sync with current setting if (!_speechCheckbox->getState()) { - ConfMan.set("speech_mute", true, _domain); + ConfMan.setBool("speech_mute", true, _domain); _vm->_voiceMode = 2; } else { - ConfMan.set("speech_mute", false, _domain); + ConfMan.setBool("speech_mute", false, _domain); _vm->_voiceMode = _subtitlesCheckbox->getState(); } diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp index 3e71073f69..fc8c0874c4 100644 --- a/engines/scumm/he/script_v70he.cpp +++ b/engines/scumm/he/script_v70he.cpp @@ -990,7 +990,7 @@ void ScummEngine_v70he::o70_writeINI() { switch (type) { case 1: // number - ConfMan.set((char *)option, value); + ConfMan.setInt((char *)option, value); debug(1, "o70_writeINI: Option %s Value %d", option, value); break; case 2: // string diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 69edc4b51c..58b87419fc 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -2134,7 +2134,7 @@ void ScummEngine_v72he::o72_writeINI() { case 6: // number value = pop(); copyScriptString(option, sizeof(option)); - ConfMan.set((char *)option, value); + ConfMan.setInt((char *)option, value); debug(1, "o72_writeINI: Option %s Value %d", option, value); break; case 77: // HE 100 diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp index b2e27d15fd..d2ab86b42d 100644 --- a/engines/scumm/input.cpp +++ b/engines/scumm/input.cpp @@ -334,18 +334,18 @@ void ScummEngine::processKbd(bool smushMode) { switch(_voiceMode) { case 0: sprintf(buf, "Speech Only"); - ConfMan.set("speech_mute", false); - ConfMan.set("subtitles", false); + ConfMan.setBool("speech_mute", false); + ConfMan.setBool("subtitles", false); break; case 1: sprintf(buf, "Speech and Subtitles"); - ConfMan.set("speech_mute", false); - ConfMan.set("subtitles", true); + ConfMan.setBool("speech_mute", false); + ConfMan.setBool("subtitles", true); break; case 2: sprintf(buf, "Subtitles Only"); - ConfMan.set("speech_mute", true); - ConfMan.set("subtitles", true); + ConfMan.setBool("speech_mute", true); + ConfMan.setBool("subtitles", true); break; } @@ -434,7 +434,7 @@ void ScummEngine::processKbd(bool smushMode) { if (vol > Audio::Mixer::kMaxMixerVolume) vol = Audio::Mixer::kMaxMixerVolume; - ConfMan.set("music_volume", vol); + ConfMan.setInt("music_volume", vol); setupVolumes(); } else if (_lastKeyHit == '-' || _lastKeyHit == '+') { // Change text speed if (_lastKeyHit == '+' && _defaultTalkDelay > 0) diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 02bf17cbbb..686e6262db 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -606,14 +606,14 @@ void ScummEngine::writeVar(uint var, int value) { if (_game.heversion <= 73 && vm.slot[_currentScript].number == 1) return; assert(value == 0 || value == 1); - ConfMan.set("subtitles", value); + ConfMan.setBool("subtitles", value); } if (VAR_NOSUBTITLES != 0xFF && var == VAR_NOSUBTITLES) { // Ignore default setting in HE60-71 games if (_game.heversion >= 60 && vm.slot[_currentScript].number == 1) return; assert(value == 0 || value == 1); - ConfMan.set("subtitles", !value); + ConfMan.setBool("subtitles", !value); } if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) { diff --git a/engines/scumm/script_v6.cpp b/engines/scumm/script_v6.cpp index 08aa7037a8..cb1bcf4de7 100644 --- a/engines/scumm/script_v6.cpp +++ b/engines/scumm/script_v6.cpp @@ -2592,7 +2592,7 @@ void ScummEngine_v6::o6_kernelSetFunctions() { _saveSound = args[1]; break; case 215: - ConfMan.set("subtitles", args[1] != 0); + ConfMan.setBool("subtitles", args[1] != 0); break; default: error("o6_kernelSetFunctions: default case %d (param count %d)", args[0], num); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 3eb074fdf4..6466f6e404 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -548,12 +548,12 @@ ScummEngine::ScummEngine(OSystem *syst, const GameSettings &gs, uint8 md5sum[16] if (ConfMan.hasKey("nosubtitles")) { printf("Configuration key 'nosubtitles' is deprecated. Use 'subtitles' instead\n"); if (!ConfMan.hasKey("subtitles")) - ConfMan.set("subtitles", !ConfMan.getBool("nosubtitles")); + ConfMan.setBool("subtitles", !ConfMan.getBool("nosubtitles")); } // Make sure that at least subtitles are enabled if (ConfMan.getBool("speech_mute") && !ConfMan.getBool("subtitles")) - ConfMan.set("subtitles", 1); + ConfMan.setBool("subtitles", true); // TODO Detect subtitle only versions of scumm6 games if (ConfMan.getBool("speech_mute")) diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index 04eecfe428..8118700eff 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -718,7 +718,7 @@ uint16 Control::toggleFx(ConResource *pButton) { _statusBar->setToText(0x7000 + 86); } - ConfMan.set("sfx_mute", (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) != 0); + ConfMan.setBool("sfx_mute", (SkyEngine::_systemVars.systemFlags & SF_FX_OFF) != 0); pButton->drawToScreen(WITH_MASK); buttonControl(pButton); @@ -742,8 +742,8 @@ uint16 Control::toggleText(void) { _statusBar->setToText(0x7000 + 35); // text only } - ConfMan.set("subtitles", (flags & SF_ALLOW_TEXT) != 0); - ConfMan.set("speech_mute", (flags & SF_ALLOW_SPEECH) == 0); + ConfMan.setBool("subtitles", (flags & SF_ALLOW_TEXT) != 0); + ConfMan.setBool("speech_mute", (flags & SF_ALLOW_SPEECH) == 0); SkyEngine::_systemVars.systemFlags |= flags; diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 0d354a3f35..5982e62e4d 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -216,16 +216,16 @@ void Sword2Engine::readSettings() { } void Sword2Engine::writeSettings() { - ConfMan.set("music_volume", _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType)); - ConfMan.set("speech_volume", _mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType)); - ConfMan.set("sfx_volume", _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType)); - ConfMan.set("music_mute", _sound->isMusicMute()); - ConfMan.set("speech_mute", _sound->isSpeechMute()); - ConfMan.set("sfx_mute", _sound->isFxMute()); - ConfMan.set("gfx_details", _screen->getRenderLevel()); - ConfMan.set("subtitles", getSubtitles()); - ConfMan.set("object_labels", _mouse->getObjectLabels()); - ConfMan.set("reverse_stereo", _sound->isReverseStereo()); + ConfMan.setInt("music_volume", _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType)); + ConfMan.setInt("speech_volume", _mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType)); + ConfMan.setInt("sfx_volume", _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType)); + ConfMan.setBool("music_mute", _sound->isMusicMute()); + ConfMan.setBool("speech_mute", _sound->isSpeechMute()); + ConfMan.setBool("sfx_mute", _sound->isFxMute()); + ConfMan.setInt("gfx_details", _screen->getRenderLevel()); + ConfMan.setBool("subtitles", getSubtitles()); + ConfMan.setBool("object_labels", _mouse->getObjectLabels()); + ConfMan.setInt("reverse_stereo", _sound->isReverseStereo()); ConfMan.flushToDisk(); } |