[Scummvm-cvs-logs] CVS: scummvm/saga game.cpp,1.117,1.118

Eugene Sandulenko sev at users.sourceforge.net
Sun Oct 16 09:53:17 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2774

Modified Files:
	game.cpp 
Log Message:
Err.. Now really fix game detection. Not that it was wrong, but I forgot
to remove old leftover which plainly overewrote all those sophisticated
checks.


Index: game.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/game.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- game.cpp	14 Oct 2005 04:28:19 -0000	1.117
+++ game.cpp	16 Oct 2005 16:50:05 -0000	1.118
@@ -1334,7 +1334,7 @@
 
 bool SagaEngine::initGame() {
 	uint16 gameCount = ARRAYSIZE(gameDescriptions);
-	int gameNumber;
+	int gameNumber = -1;
 	FSList dummy;
 	DetectedGameList detectedGames;
 	int *matches;
@@ -1363,8 +1363,10 @@
 				if ((gameDescriptions[matches[i]].language != language &&
 					 language != Common::UNK_LANG) ||
 					(gameDescriptions[matches[i]].platform != platform &&
-					 platform != Common::kPlatformUnknown))
+					 platform != Common::kPlatformUnknown)) {
+					debug(2, "Purged (pass 2) %s", gameDescriptions[matches[i]].title);
 					matches[i] = -1;
+				}
 				else
 					count++;
 			}
@@ -1382,13 +1384,12 @@
 
 	free(matches);
 
-	if ((gameNumber = detectGame(dummy)) == -1) {
-	}
-
-	if (gameNumber >= gameCount) {
+	if (gameNumber >= gameCount || gameNumber == -1) {
 		error("SagaEngine::loadGame wrong gameNumber");
 	}
 
+	debug(2, "Running %s", gameDescriptions[gameNumber].title);
+
 	_gameNumber = gameNumber;
 	_gameDescription = &gameDescriptions[gameNumber];
 	_gameDisplayInfo = *_gameDescription->gameDisplayInfo;
@@ -1441,7 +1442,7 @@
 				if (gameMD5[j].id == gameDescriptions[matches[i]].gameId)
 					count++;
 			if (count < maxcount) {
-				debug(0, "Purged: %s", gameDescriptions[matches[i]].title);
+				debug(2, "Purged: %s", gameDescriptions[matches[i]].title);
 				matches[i] = -1;
 			}
 		}
@@ -1551,7 +1552,7 @@
 		} else {
 			bool match = true;
 
-			debug(5, "Probing game: %s", gameDescriptions[game_n].title);
+			debug(2, "Probing game: %s", gameDescriptions[game_n].title);
 
 			for (int i = 0; i < ARRAYSIZE(gameMD5); i++) {
 				if (gameMD5[i].id == gameDescriptions[game_n].gameId) {
@@ -1566,7 +1567,7 @@
 			if (!match)
 				continue;
 
-			debug(5, "Found game: %s", gameDescriptions[game_n].title);
+			debug(2, "Found game: %s", gameDescriptions[game_n].title);
 
 			return game_n;
 		}





More information about the Scummvm-git-logs mailing list