[Scummvm-cvs-logs] SF.net SVN: scummvm: [20738] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Feb 16 16:02:03 CET 2006


Revision: 20738
Author:   fingolfin
Date:     2006-02-16 16:01:18 -0800 (Thu, 16 Feb 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm?rev=20738&view=rev

Log Message:
-----------
Reduced use of GF_DEFAULT_TO_1X_SCALER in favor of a new param to Engine::initCommonGFX; added a TODO stating that it should eventually be removed completly

Modified Paths:
--------------
    scummvm/trunk/TODO
    scummvm/trunk/base/engine.cpp
    scummvm/trunk/base/engine.h
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/kyra/kyra.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/saga/gfx.cpp
    scummvm/trunk/engines/scumm/scumm.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/sky/sky.cpp
    scummvm/trunk/engines/sword1/sword1.cpp
    scummvm/trunk/engines/sword2/sword2.cpp
Modified: scummvm/trunk/TODO
===================================================================
--- scummvm/trunk/TODO	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/TODO	2006-02-17 00:01:18 UTC (rev 20738)
@@ -318,6 +318,12 @@
 =======
 * Fix engines so they clean up after themselves, to allow proper re-entry
   to the launcher. See "FIXME: LAUNCHERHACK" in base/main.cpp
+* Get rid of GF_DEFAULT_TO_1X_SCALER and the 'defaultTo1XScaler' parameter of
+  Engine::initCommonGFX. They form a crude hack to better support 640x480 games
+  and are meant to prevent those games from being accidentally scaled to a size
+  that won't fit on the screen. However, the proper fix would be to modify the
+  backends so that they simply fall back to a smaller scaler when a combination
+  is requested that can't be satisfied.
 
 SCUMM
 =====

Modified: scummvm/trunk/base/engine.cpp
===================================================================
--- scummvm/trunk/base/engine.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/base/engine.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -60,7 +60,7 @@
 	g_engine = NULL;
 }
 
-void Engine::initCommonGFX(GameDetector &detector) {
+void Engine::initCommonGFX(GameDetector &detector, bool defaultTo1XScaler) {
 	const bool useDefaultGraphicsMode =
 		!ConfMan.hasKey("gfx_mode", Common::ConfigManager::kTransientDomain) &&
 		(
@@ -70,7 +70,7 @@
 		);
 
 	// See if the game should default to 1x scaler
-	if (useDefaultGraphicsMode && (detector._game.features & GF_DEFAULT_TO_1X_SCALER)) {
+	if (useDefaultGraphicsMode && defaultTo1XScaler) {
 		// FIXME: As a hack, we use "1x" here. Would be nicer to use
 		// getDefaultGraphicsMode() instead, but right now, we do not specify
 		// whether that is a 1x scaler or not...

Modified: scummvm/trunk/base/engine.h
===================================================================
--- scummvm/trunk/base/engine.h	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/base/engine.h	2006-02-17 00:01:18 UTC (rev 20738)
@@ -72,7 +72,7 @@
 	/** Specific for each engine: prepare error string. */
 	virtual void errorString(const char *buf_input, char *buf_output);
 
-	void initCommonGFX(GameDetector &detector);
+	void initCommonGFX(GameDetector &detector, bool defaultTo1XScaler);
 
 	/** On some systems, check if the game appears to be run from CD. */
 	void checkCD();

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/gob/gob.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -316,7 +316,7 @@
 		_music = new Music(this);
 
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, false);
 		_system->initSize(320, 200);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -322,7 +322,7 @@
 
 int KyraEngine::init(GameDetector &detector) {
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, false);
 		//for debug reasons (see Screen::updateScreen)
 		//_system->initSize(640, 200);
 		_system->initSize(320, 200);

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/lure/lure.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -244,7 +244,7 @@
 
 int LureEngine::init(GameDetector &detector) {
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, false);
 		_system->initSize(FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/queen/queen.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -404,7 +404,7 @@
 
 int QueenEngine::init(GameDetector &detector) {
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, false);
 		_system->initSize(GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/saga/gfx.cpp
===================================================================
--- scummvm/trunk/engines/saga/gfx.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/saga/gfx.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -38,7 +38,7 @@
 
 Gfx::Gfx(SagaEngine *vm, OSystem *system, int width, int height, GameDetector &detector) : _vm(vm), _system(system) {
 	_system->beginGFXTransaction();
-		_vm->initCommonGFX(detector);
+		_vm->initCommonGFX(detector, (width > 320));
 		_system->initSize(width, height);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/scumm/scumm.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -1811,7 +1811,7 @@
 		} else {
 			_system->initSize(_screenWidth, _screenHeight, (detector._force1xOverlay ? 1 : 2));
 		}
-		initCommonGFX(detector);
+		initCommonGFX(detector, (_features & GF_DEFAULT_TO_1X_SCALER) != 0);
 	_system->endGFXTransaction();
 
 	// On some systems it's not safe to run CD audio games from the CD.

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -540,7 +540,6 @@
 	if (getGameType() == GType_FF) {
 		_screenWidth = 640;
 		_screenHeight = 480;
-		detector._game.features |= GF_DEFAULT_TO_1X_SCALER;
 	} else {
 		_screenWidth = 320;
 		_screenHeight = 200;
@@ -554,7 +553,7 @@
 	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
 
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, getGameType() == GType_FF);
 		_system->initSize(_screenWidth, _screenHeight);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/sky/sky.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -302,7 +302,7 @@
 
 int SkyEngine::init(GameDetector &detector) {
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, false);
 		_system->initSize(320, 200);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/sword1/sword1.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sword1.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/sword1/sword1.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -157,7 +157,7 @@
 int SwordEngine::init(GameDetector &detector) {
 
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, true);
 		_system->initSize(640, 480);
 	_system->endGFXTransaction();
 

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2006-02-16 23:43:51 UTC (rev 20737)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2006-02-17 00:01:18 UTC (rev 20738)
@@ -232,7 +232,7 @@
 	// away
 
 	_system->beginGFXTransaction();
-		initCommonGFX(detector);
+		initCommonGFX(detector, true);
 		_screen = new Screen(this, 640, 480);
 	_system->endGFXTransaction();
 







More information about the Scummvm-git-logs mailing list