[Scummvm-cvs-logs] CVS: scummvm/common engine.cpp,1.19,1.20 gameDetector.cpp,1.102,1.103 gameDetector.h,1.41,1.42 main.cpp,1.31,1.32

Max Horn fingolfin at users.sourceforge.net
Fri Jun 6 16:23:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv24980/common

Modified Files:
	engine.cpp gameDetector.cpp gameDetector.h main.cpp 
Log Message:
Preparations for removing GF_AFTER_V? flags

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- engine.cpp	30 Apr 2003 12:43:53 -0000	1.19
+++ engine.cpp	6 Jun 2003 22:51:31 -0000	1.20
@@ -82,21 +82,21 @@
 	Engine *engine = NULL;
 
 #ifndef DISABLE_SCUMM
-	if (detector->_gameId >= GID_SCUMM_FIRST && detector->_gameId <= GID_SCUMM_LAST) {
+	if (detector->_game.id >= GID_SCUMM_FIRST && detector->_game.id <= GID_SCUMM_LAST) {
 		// Some kind of Scumm game
 		engine = Engine_SCUMM_create(detector, syst);
 	}
 #endif
 
 #ifndef DISABLE_SIMON
-	if (detector->_gameId >= GID_SIMON_FIRST && detector->_gameId <= GID_SIMON_LAST) {
+	if (detector->_game.id >= GID_SIMON_FIRST && detector->_game.id <= GID_SIMON_LAST) {
 		// Simon the Sorcerer
 		engine = Engine_SIMON_create(detector, syst);
 	}
 #endif
 
 #ifndef DISABLE_SKY
-	if (detector->_gameId >= GID_SKY_FIRST && detector->_gameId <= GID_SKY_LAST) {
+	if (detector->_game.id >= GID_SKY_FIRST && detector->_game.id <= GID_SKY_LAST) {
 		// Beneath a Steel Sky
 		engine = Engine_SKY_create(detector, syst);
 	}

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- gameDetector.cpp	2 Jun 2003 22:07:41 -0000	1.102
+++ gameDetector.cpp	6 Jun 2003 22:51:31 -0000	1.103
@@ -148,7 +148,6 @@
 
 GameDetector::GameDetector() {
 	_fullScreen = false;
-	_gameId = 0;
 
 	_use_adlib = false;
 
@@ -168,7 +167,8 @@
 	_gameDataPath = 0;
 	_gameTempo = 0;
 	_midi_driver = MD_AUTO;
-	_features = 0;
+	_game.id = 0;
+	_game.features = 0;
 
 	_multi_midi = false;
 	_native_mt32 = false;
@@ -289,26 +289,14 @@
 
 void GameDetector::list_games() {
 	const VersionSettings *v = version_settings;
-	char config[4] = "";
+	const char *config;
 
 	printf("Game          SCUMM ver Full Title                                     Config\n"
 	       "------------- --------- ---------------------------------------------- -------\n");
 
 	while (v->filename && v->gamename) {
-		if (g_config->has_domain(v->filename)) {
-			strcpy(config, "Yes");
-		}
-		else {
-			strcpy(config, "");
-		}
-
-		if (v->major != 99)
-			printf("%-14s%d.%d.%d\t%-47s%s\n", v->filename,
-		     	  v->major, v->middle, v->minor, v->gamename, config);
-		else
-			printf("%-14s%-7s\t%-47s%s\n", v->filename, "n/a", 
-					v->gamename, config);
-
+		config = (g_config->has_domain(v->filename)) ? "Yes" : "";
+		printf("%-14s%-7s\t%-47s%s\n", v->filename, "n/a", v->gamename, config);
 		v++;
 	}
 		
@@ -578,27 +566,23 @@
 bool GameDetector::detectGame() {
 	const VersionSettings *gnl = version_settings;
 	const char *realGame, *basename;
-	_gameId = 0;
+	_game.id = 0;
 	_gameText.clear();
 
-	if (!(realGame = g_config->get("gameid")))
+	realGame = g_config->get("gameid");
+	if (!realGame)
 		realGame = _gameFileName.c_str();
 	printf("Looking for %s\n", realGame);
 
 	do {
 		if (!scumm_stricmp(realGame, gnl->filename)) {
-			_gameId = gnl->id;
-			if ((basename = g_config->get("basename")))
-				_gameRealName = basename;
-			else
-				_gameRealName = gnl->filename;
-			_features = gnl->features;
+			_game = *gnl;
+			if ((basename = g_config->get("basename")))	{
+				// FIXME: What is this good for?
+				_game.filename = basename;
+			}
 			_gameText = gnl->gamename;
-			if (gnl->major != 99)
-				debug(1, "Trying to start game '%s', version %d.%d.%d",
-							gnl->gamename, gnl->major, gnl->middle, gnl->minor);
-			else
-				debug(1, "Trying to start game '%s'",gnl->gamename);
+			debug(1, "Trying to start game '%s'",gnl->gamename);
 			return true;
 		}
 	} while ((++gnl)->filename);
@@ -633,7 +617,7 @@
 	 * default, OR if the game is an older game that doesn't
 	 * support anything else anyway. */
 #ifndef __PALM_OS__ // currently adlib is not supported, is this really needed ?
-	if ((_midi_driver == MD_AUTO && _features & GF_ADLIB_DEFAULT) || _features & GF_SMALL_HEADER) {
+	if ((_midi_driver == MD_AUTO && _game.features & GF_ADLIB_DEFAULT) || _game.features & GF_SMALL_HEADER) {
 		_midi_driver = MD_ADLIB;
 		_use_adlib = true;
 	}
@@ -668,7 +652,7 @@
 #elif defined(X11_BACKEND)
 	return OSystem_X11_create();
 #elif defined(__MORPHOS__)
-	return OSystem_MorphOS_create(_gameId, _gfx_mode, _fullScreen);
+	return OSystem_MorphOS_create(_game.id, _gfx_mode, _fullScreen);
 #elif defined(_WIN32_WCE)
 	return OSystem_WINCE3_create();
 #elif defined(MACOS_CARBON)

Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- gameDetector.h	2 Jun 2003 21:29:54 -0000	1.41
+++ gameDetector.h	6 Jun 2003 22:51:31 -0000	1.42
@@ -100,7 +100,7 @@
 struct VersionSettings {
 	const char *filename;
 	const char *gamename;
-	byte id, major, middle, minor;
+	byte id, version;
 	uint32 features;
 	char *detectname;
 };
@@ -142,7 +142,6 @@
 	const String& getGameName(void);
 	
 	bool _fullScreen;
-	byte _gameId;
 
 	bool _use_adlib;
 
@@ -162,10 +161,9 @@
 	char *_gameDataPath;
 	int _gameTempo;
 	int _midi_driver;
+
 	String _gameFileName;
-	String _gameText;
-	String _gameRealName;
-	uint32 _features;
+	VersionSettings _game;
 
 	int _gfx_mode;
 	bool _default_gfx_mode;
@@ -187,6 +185,8 @@
 	void updateconfig();
 
 protected:
+	String _gameText;
+
 	bool detectGame(void);
 	bool parseMusicDriver(const char *s);
 	int parseLanguage(const char *s);

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/main.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- main.cpp	29 May 2003 23:13:15 -0000	1.31
+++ main.cpp	6 Jun 2003 22:51:31 -0000	1.32
@@ -213,7 +213,7 @@
 
 	// See if the game should default to 1x scaler
 	if ((detector._default_gfx_mode) && 
-	   (detector._features & GF_DEFAULT_TO_1X_SCALER)) {
+	   (detector._game.features & GF_DEFAULT_TO_1X_SCALER)) {
 		prop.gfx_mode = GFX_NORMAL;
 		system->property(OSystem::PROP_SET_GFX_MODE, &prop);
 	}





More information about the Scummvm-git-logs mailing list