[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.698,1.699

Max Horn fingolfin at users.sourceforge.net
Sat Jan 21 04:02:09 CET 2006


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

Modified Files:
	scumm.cpp 
Log Message:
cleanup

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.698
retrieving revision 1.699
diff -u -d -r1.698 -r1.699
--- scumm.cpp	18 Jan 2006 16:12:44 -0000	1.698
+++ scumm.cpp	21 Jan 2006 12:01:39 -0000	1.699
@@ -3277,37 +3277,29 @@
 		}
 	}
 
-	// Check if MD5 was overwritten
+	// Check if the MD5 was overwritten, if so, use that in the subsequent search
+	const char *md5;
 	if (ConfMan.hasKey("target_md5")) {
-		const char *md5 = ConfMan.get("target_md5").c_str();
-
-		g = multiple_versions_md5_settings;
-		while (g->name) {
-			if (!scumm_stricmp(md5, g->name))
-				break;
-			g++;
-		}
-		if (g->name) {
-			game = *g;
-			game.name = name;
-			if (game.description)
-				g_system->setWindowCaption(game.description);
-		}
+		md5 = ConfMan.get("target_md5").c_str();
 	} else {
-		// Perform MD5-based search
-		g = multiple_versions_md5_settings;
-		while (g->name) {
-			if (!scumm_stricmp(gameMD5, g->name))
-				break;
-			g++;
-		}
-		if (g->name) {
+		md5 = gameMD5;
+	}
+
+	// Now search our 'database' for the MD5; if a match is found, we use 
+	// the information in the 'database' to correct the GameSettings.
+	g = multiple_versions_md5_settings;
+	while (g->name) {
+		if (!scumm_stricmp(md5, g->name)) {
+			// Match found
 			game = *g;
 			game.name = name;
 			if (game.description)
 				g_system->setWindowCaption(game.description);
+			break;
 		}
+		g++;
 	}
+
 	// Starting from version 7.1, HE games use 640x480. We check this here since multiple
 	// versions _could_ use different resolutions (I haven't verified this, though).
 	if (game.heversion >= 71) {





More information about the Scummvm-git-logs mailing list