From b4e5d97994a5827350e030429caea364514dadda Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 5 Oct 2003 14:37:16 +0000 Subject: 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 --- base/main.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'base/main.cpp') 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); -- cgit v1.2.3