diff options
author | Max Horn | 2006-04-15 13:12:03 +0000 |
---|---|---|
committer | Max Horn | 2006-04-15 13:12:03 +0000 |
commit | 3628629007e4b97b7b634d0545e3acd474c7708b (patch) | |
tree | 4c357399bf7bb1ea4fbea8faa91fc631b2ef5847 /base/engine.cpp | |
parent | 2f024e270199d5fc2d38d62150b689a1fdca0b1d (diff) | |
download | scummvm-rg350-3628629007e4b97b7b634d0545e3acd474c7708b.tar.gz scummvm-rg350-3628629007e4b97b7b634d0545e3acd474c7708b.tar.bz2 scummvm-rg350-3628629007e4b97b7b634d0545e3acd474c7708b.zip |
- Replaced ConfigManager::_globalDomains by _appDomain (we don't support multiple global domains anymore)
- Restructured parts of the ConfigManager to be more consistent and a bit easier to understand
- Introduced ConfigManager::getDomain, potentially useful for code that needs to edit a specific domain (like the option dialogs)
- Allow passing an empty string to ConfigManager::setActiveDomain(), to reset the active domain
- Discard all transient config options (i.e. mostly command line settings) when entering the launcher, and after an engine exits
- Introduced various hidden easter bugs. Happy easter, and have fun searching!
svn-id: r21906
Diffstat (limited to 'base/engine.cpp')
-rw-r--r-- | base/engine.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/base/engine.cpp b/base/engine.cpp index fb46949050..a3767d1bf4 100644 --- a/base/engine.cpp +++ b/base/engine.cpp @@ -56,12 +56,18 @@ Engine::~Engine() { } void Engine::initCommonGFX(GameDetector &detector, bool defaultTo1XScaler) { + const Common::ConfigManager::Domain *transientDomain = ConfMan.getDomain(Common::ConfigManager::kTransientDomain); + const Common::ConfigManager::Domain *gameDomain = ConfMan.getDomain(detector._targetName); + + assert(transientDomain); + const bool useDefaultGraphicsMode = - !ConfMan.hasKey("gfx_mode", Common::ConfigManager::kTransientDomain) && + !transientDomain->contains("gfx_mode") && ( - !ConfMan.hasKey("gfx_mode", detector._targetName) || - !scumm_stricmp(ConfMan.get("gfx_mode", detector._targetName).c_str(), "normal") || - !scumm_stricmp(ConfMan.get("gfx_mode", detector._targetName).c_str(), "default") + !gameDomain || + !gameDomain->contains("gfx_mode") || + !scumm_stricmp(gameDomain->get("gfx_mode").c_str(), "normal") || + !scumm_stricmp(gameDomain->get("gfx_mode").c_str(), "default") ); // See if the game should default to 1x scaler @@ -77,12 +83,19 @@ void Engine::initCommonGFX(GameDetector &detector, bool defaultTo1XScaler) { } } + // Note: The following code deals with the fullscreen / ASR settings. This + // is a bit tricky, because there are three ways the user can affect these + // settings: Via the config file, via the command line, and via in-game + // hotkeys. + // Any global or command line settings already have been applied at the time + // we get here. Hence we only do something + // (De)activate aspect-ratio correction as determined by the config settings - if (ConfMan.hasKey("aspect_ratio", detector._targetName)) + if (gameDomain && gameDomain->contains("aspect_ratio")) _system->setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio")); // (De)activate fullscreen mode as determined by the config settings - if (ConfMan.hasKey("fullscreen", detector._targetName)) + if (gameDomain && gameDomain->contains("fullscreen")) _system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen")); } |