diff options
author | Max Horn | 2003-10-05 14:37:16 +0000 |
---|---|---|
committer | Max Horn | 2003-10-05 14:37:16 +0000 |
commit | b4e5d97994a5827350e030429caea364514dadda (patch) | |
tree | 639bb20ae3e68f000e61293c165b8ea8929b16f7 /base | |
parent | bfde7528bab0dfa74bde6173ca31d61818c01bd9 (diff) | |
download | scummvm-rg350-b4e5d97994a5827350e030429caea364514dadda.tar.gz scummvm-rg350-b4e5d97994a5827350e030429caea364514dadda.tar.bz2 scummvm-rg350-b4e5d97994a5827350e030429caea364514dadda.zip |
factor out common gfx_mode/fullscreen setup code from the game engines into the main code (maybe putting this into the Engine constructor would be better, though?)
svn-id: r10611
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/base/main.cpp b/base/main.cpp index 2a2cf17428..98fd8413f5 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -306,13 +306,29 @@ int main(int argc, char *argv[]) { prop.caption = detector.getGameName().c_str(); system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop); + // FIXME: It seem not logical that we first might set the gfx mode to + // 1x, and then immediately after might override it again. We probably + // should combine both checks into one. + // See if the game should default to 1x scaler if ((detector._default_gfx_mode) && (detector._game.features & GF_DEFAULT_TO_1X_SCALER)) { prop.gfx_mode = GFX_NORMAL; system->property(OSystem::PROP_SET_GFX_MODE, &prop); } - + + // Override global scaler with any game-specific define + if (g_config->get("gfx_mode")) { + prop.gfx_mode = detector.parseGraphicsMode(g_config->get("gfx_mode")); + system->property(OSystem::PROP_SET_GFX_MODE, &prop); + } + + // Override global fullscreen setting with any game-specific define + if (g_config->getBool("fullscreen", false)) { + if (!system->property(OSystem::PROP_GET_FULLSCREEN, 0)) + system->property(OSystem::PROP_TOGGLE_FULLSCREEN, 0); + } + // Create the game engine Engine *engine = detector.createEngine(system); assert(engine); |