[Scummvm-cvs-logs] CVS: scummvm/base main.cpp,1.11,1.12

Max Horn fingolfin at users.sourceforge.net
Sun Oct 5 07:38:03 CEST 2003


Update of /cvsroot/scummvm/scummvm/base
In directory sc8-pr-cvs1:/tmp/cvs-serv17277/base

Modified Files:
	main.cpp 
Log Message:
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?)

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/base/main.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- main.cpp	5 Oct 2003 13:57:31 -0000	1.11
+++ main.cpp	5 Oct 2003 14:37:15 -0000	1.12
@@ -306,13 +306,29 @@
 			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);





More information about the Scummvm-git-logs mailing list