[Scummvm-cvs-logs] CVS: scummvm/sky sky.cpp,1.117,1.118
Max Horn
fingolfin at users.sourceforge.net
Wed Oct 8 15:00:06 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv6106/sky
Modified Files:
sky.cpp
Log Message:
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
Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- sky.cpp 5 Oct 2003 20:21:19 -0000 1.117
+++ sky.cpp 8 Oct 2003 21:59:23 -0000 1.118
@@ -24,6 +24,7 @@
#include "base/gameDetector.h"
#include "base/plugins.h"
+#include "common/config-manager.h"
#include "common/file.h"
#include "common/timer.h"
@@ -103,13 +104,13 @@
if (!_mixer->bindToSystem(syst))
warning("Sound initialisation failed.");
- _mixer->setVolume(detector->_sfx_volume); //unnecessary?
+ _mixer->setVolume(ConfMan.getInt("sfx_volume")); //unnecessary?
_debugMode = detector->_debugMode;
- _debugLevel = detector->_debugLevel;
+ _debugLevel = ConfMan.getInt("debuglevel");
_detector = detector;
- _floppyIntro = detector->_floppyIntro;
+ _floppyIntro = ConfMan.getBool("floppy_intro");
_fastMode = 0;
@@ -251,7 +252,7 @@
void SkyEngine::initialise(void) {
_skyDisk = new SkyDisk(_gameDataPath);
- _skySound = new SkySound(_mixer, _skyDisk, _detector->_sfx_volume);
+ _skySound = new SkySound(_mixer, _skyDisk, ConfMan.getInt("sfx_volume"));
_systemVars.gameVersion = _skyDisk->determineGameVersion();
@@ -260,14 +261,14 @@
_skyMusic = new SkyAdlibMusic(_mixer, _skyDisk, _system);
} else {
_systemVars.systemFlags |= SF_ROLAND;
- if (_detector->_native_mt32)
+ if (ConfMan.getBool("native_mt32"))
_skyMusic = new SkyMT32Music(_detector->createMidi(), _skyDisk, _system);
else
_skyMusic = new SkyGmMusic(_detector->createMidi(), _skyDisk, _system);
}
if (isCDVersion()) {
- if (_detector->_noSubtitles)
+ if (ConfMan.getBool("nosubtitles"))
_systemVars.systemFlags |= SF_ALLOW_SPEECH;
else
_systemVars.systemFlags |= SF_ALLOW_SPEECH | SF_ALLOW_TEXT;
@@ -296,10 +297,11 @@
if (_systemVars.gameVersion == 288)
SkyCompact::patchFor288();
- if (_detector->_language > 10)
+ int language = GameDetector::parseLanguage(ConfMan.get("language"));
+ if (language < 0 || language > 10)
_systemVars.language = SKY_USA;
else
- _systemVars.language = _languageTable[_detector->_language];
+ _systemVars.language = _languageTable[language];
if (!_skyDisk->fileExists(60600 + SkyEngine::_systemVars.language * 8)) {
warning("The language you selected does not exist in your BASS version.");
@@ -316,15 +318,15 @@
}
uint16 result = 0;
- if (_detector->_save_slot >= 0)
- result = _skyControl->quickXRestore(_detector->_save_slot);
+ if (ConfMan.hasKey("save_slot") && ConfMan.getInt("save_slot") >= 0)
+ result = _skyControl->quickXRestore(ConfMan.getInt("save_slot"));
if (result == GAME_RESTORED)
_quickLaunch = true;
else
_quickLaunch = false;
- _skyMusic->setVolume(_detector->_music_volume >> 1);
+ _skyMusic->setVolume(ConfMan.getInt("music_volume") >> 1);
}
void SkyEngine::initItemList() {
More information about the Scummvm-git-logs
mailing list