[Scummvm-cvs-logs] CVS: scummvm/scumm scummvm.cpp,2.524,2.525

Max Horn fingolfin at users.sourceforge.net
Tue Dec 30 11:09:03 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv32511

Modified Files:
	scummvm.cpp 
Log Message:
hook up MD5 database (this is still kind of a hack, but at least it shows that the approach works :-)

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.524
retrieving revision 2.525
diff -u -d -r2.524 -r2.525
--- scummvm.cpp	30 Dec 2003 16:53:28 -0000	2.524
+++ scummvm.cpp	30 Dec 2003 19:08:45 -0000	2.525
@@ -294,6 +294,12 @@
 	{NULL, NULL, 0, 0, MDT_NONE, 0, 0}
 };
 
+static int compareMD5Table(const void *a, const void *b) {
+	const char *key = (const char *)a;
+	const MD5Table *elem = (const MD5Table *)b;
+	return strcmp(key, elem->md5);
+}
+
 ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs)
 	: Engine(syst),
 	  _gameId(gs.id),
@@ -649,9 +655,19 @@
 	}
 	
 	if (md5_file(buf, md5sum)) {
+		char md5str[32+1];
 		for (int j = 0; j < 16; j++)
-			printf("%02x", md5sum[j]);
-		printf("  %s\n", buf);
+			sprintf(md5str+j*2, "%02x", md5sum[j]);
+		md5str[32] = 0;
+		printf("%s  %s\n", md5str, buf);
+		const MD5Table *elem;
+		elem = (const MD5Table *)bsearch(md5str, md5table, ARRAYSIZE(md5table)-1, sizeof(MD5Table), compareMD5Table);
+		if (elem)
+			printf("Match found in database: target %s, language %s, platform %s\n",
+				elem->target, Common::getLanguageDescription(elem->language), Common::getPlatformDescription(elem->platform));
+		else
+			printf("Unknown MD5! Please report the details (language, platform, etc.) of this game to the ScummVM team\n");
+
 	}
 #endif
 





More information about the Scummvm-git-logs mailing list