aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-10-08 21:59:23 +0000
committerMax Horn2003-10-08 21:59:23 +0000
commitd1773647159f9ef1393d7a1d33204de5886edce5 (patch)
treed31f1a3689fa34a525671f21d7a858fe8570762f /scumm
parent3c78c0929c553fd67016f87c6cdc38d3f50d7ca2 (diff)
downloadscummvm-rg350-d1773647159f9ef1393d7a1d33204de5886edce5.tar.gz
scummvm-rg350-d1773647159f9ef1393d7a1d33204de5886edce5.tar.bz2
scummvm-rg350-d1773647159f9ef1393d7a1d33204de5886edce5.zip
new config manager. not everything is completed, and some things will still be changed, but it seems to work well enough to put it into CVS
svn-id: r10687
Diffstat (limited to 'scumm')
-rw-r--r--scumm/dialogs.cpp14
-rw-r--r--scumm/saveload.cpp2
-rw-r--r--scumm/scummvm.cpp60
-rw-r--r--scumm/sound.cpp2
4 files changed, 41 insertions, 37 deletions
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index 51ee68aadb..94e59cdd08 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -34,7 +34,7 @@
#include "gui/newgui.h"
#include "gui/ListWidget.h"
-#include "common/config-file.h"
+#include "common/config-manager.h"
#ifdef _WIN32_WCE
#include "gapi_keys.h"
@@ -546,13 +546,13 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
_scumm->_mixer->setVolume(_soundVolumeSfx * _soundVolumeMaster / 255);
_scumm->_mixer->setMusicVolume(_soundVolumeMusic);
- g_config->setInt("master_volume", _soundVolumeMaster);
- g_config->setInt("music_volume", _soundVolumeMusic);
- g_config->setInt("sfx_volume", _soundVolumeSfx);
+ ConfMan.set("master_volume", _soundVolumeMaster);
+ ConfMan.set("music_volume", _soundVolumeMusic);
+ ConfMan.set("sfx_volume", _soundVolumeSfx);
// Subtitles?
_scumm->_noSubtitles = !subtitlesCheckbox->getState();
- g_config->setBool("nosubtitles", _scumm->_noSubtitles);
+ ConfMan.set("nosubtitles", _scumm->_noSubtitles);
// Amiga version?
if (amigaCheckbox->getState())
@@ -560,10 +560,10 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
else
_scumm->setFeatures (_scumm->_features & (~GF_AMIGA));
- g_config->setBool("amiga", amigaCheckbox->getState());
+ ConfMan.set("amiga", amigaCheckbox->getState());
// Finally flush the modified config
- g_config->flush();
+ ConfMan.flushToDisk();
}
case kCancelCmd:
close();
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp
index b8adbc7a8c..a3d727bd7a 100644
--- a/scumm/saveload.cpp
+++ b/scumm/saveload.cpp
@@ -22,7 +22,7 @@
#include "stdafx.h"
-#include "common/config-file.h"
+#include "common/config-manager.h"
#include "scumm/actor.h"
#include "scumm/charset.h"
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index a7c7f2a665..b493a71257 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -25,7 +25,7 @@
#include "base/gameDetector.h"
#include "base/plugins.h"
-#include "common/config-file.h"
+#include "common/config-manager.h"
#include "gui/console.h"
#include "gui/message.h"
@@ -595,22 +595,22 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
g_debugger = new ScummDebugger;
_debugMode = detector->_debugMode;
- _debugLevel = detector->_debugLevel;
+ _debugLevel = ConfMan.getInt("debuglevel");
_dumpScripts = detector->_dumpScripts;
- _bootParam = detector->_bootParam;
+ _bootParam = ConfMan.getInt("boot_param");
_exe_name = strdup(detector->_game.targetName);
_game_name = strdup(detector->_gameFileName.c_str());
_gameId = detector->_game.id;
_version = detector->_game.version;
setFeatures(detector->_game.features);
- _demoMode = detector->_demo_mode;
- _noSubtitles = detector->_noSubtitles;
- _confirmExit = detector->_confirmExit;
- _defaultTalkDelay = detector->_talkSpeed;
+ _demoMode = ConfMan.getBool("demo_mode");
+ _noSubtitles = ConfMan.getBool("nosubtitles");
+ _confirmExit = ConfMan.getBool("confirm_exit");
+ _defaultTalkDelay = ConfMan.getInt("talkspeed");
_midiDriver = detector->_midi_driver;
- _native_mt32 = detector->_native_mt32;
- _language = detector->_language;
+ _native_mt32 = ConfMan.getBool("native_mt32");
+ _language = GameDetector::parseLanguage(ConfMan.get("language"));
memset(&res, 0, sizeof(res));
_hexdumpScripts = false;
_showStack = false;
@@ -634,13 +634,13 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
_newgui = g_gui;
_sound = new Sound(this);
- _sound->_sound_volume_master = detector->_master_volume;
- _sound->_sound_volume_sfx = detector->_sfx_volume;
- _sound->_sound_volume_music = detector->_music_volume;
+ _sound->_sound_volume_master = ConfMan.getInt("master_volume");
+ _sound->_sound_volume_sfx = ConfMan.getInt("music_volume");
+ _sound->_sound_volume_music = ConfMan.getInt("sfx_volume");
/* Initialize backend */
syst->init_size(_screenWidth, _screenHeight);
- prop.cd_num = detector->_cdrom;
+ prop.cd_num = ConfMan.getInt("cdrom");
if (prop.cd_num >= 0 && (_features & GF_AUDIOTRACKS))
syst->property(OSystem::PROP_OPEN_CD, &prop);
@@ -681,16 +681,16 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
_musicEngine = new Player_V2(this, _midiDriver != MD_PCSPK);
} else if (_version > 2) {
MidiDriver *driver = detector->createMidi();
- if (driver && detector->_native_mt32)
+ if (driver && _native_mt32)
driver->property (MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
_musicEngine = _imuse = IMuse::create(syst, _mixer, driver);
if (_imuse) {
- if (detector->_gameTempo != 0)
- _imuse->property(IMuse::PROP_TEMPO_BASE, detector->_gameTempo);
+ if (ConfMan.hasKey("tempo"))
+ _imuse->property(IMuse::PROP_TEMPO_BASE, ConfMan.getInt("tempo"));
_imuse->property(IMuse::PROP_OLD_ADLIB_INSTRUMENTS, (_features & GF_SMALL_HEADER) ? 1 : 0);
- _imuse->property(IMuse::PROP_MULTI_MIDI, detector->_multi_midi &&
+ _imuse->property(IMuse::PROP_MULTI_MIDI, ConfMan.getBool("multi_midi") &&
_midiDriver != MD_NULL && (detector->_game.midi & MDT_ADLIB));
- _imuse->property(IMuse::PROP_NATIVE_MT32, detector->_native_mt32);
+ _imuse->property(IMuse::PROP_NATIVE_MT32, _native_mt32);
if (_features & GF_HUMONGOUS || _features & GF_FMTOWNS) {
_imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1);
_imuse->property(IMuse::PROP_RECYCLE_PLAYERS, 1);
@@ -703,8 +703,8 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
#endif // ph0x-hack
// Load game from specified slot, if any
- if (detector->_save_slot != -1) {
- _saveLoadSlot = detector->_save_slot;
+ if (ConfMan.hasKey("save_slot")) {
+ _saveLoadSlot = ConfMan.getInt("save_slot");
_saveLoadFlag = 2;
_saveLoadCompatible = false;
}
@@ -2647,20 +2647,24 @@ const TargetSettings *Engine_SCUMM_targetList() {
Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) {
Engine *engine;
- if (detector->_amiga)
- detector->_game.features |= GF_AMIGA;
-
- switch (detector->_platform) {
- case 1:
- if (!(detector->_game.features & GF_AMIGA))
+ if (ConfMan.hasKey("amiga")) {
+ warning("Configuration key 'amiga' is deprecated. Use 'platform=amiga' instead");
+ if (ConfMan.getBool("amiga"))
detector->_game.features |= GF_AMIGA;
+ }
+
+ switch (GameDetector::parsePlatform(ConfMan.get("platform"))) {
+ case kPlatformAmiga:
+ detector->_game.features |= GF_AMIGA;
break;
- case 2:
+ case kPlatformAtariST:
detector->_game.features |= GF_ATARI_ST;
break;
- case 3:
+ case kPlatformMacintosh:
detector->_game.features |= GF_MACINTOSH;
break;
+ default:
+ break;
}
switch (detector->_game.version) {
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 6dffa34457..fd55633bd1 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -28,7 +28,7 @@
#include "scumm/scumm.h"
#include "scumm/sound.h"
-#include "common/config-file.h"
+#include "common/config-manager.h"
#include "common/timer.h"
#include "common/util.h"