[Scummvm-cvs-logs] SF.net SVN: scummvm:[43509] scummvm/trunk/engines/sci/detection.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Tue Aug 18 14:49:34 CEST 2009


Revision: 43509
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43509&view=rev
Author:   thebluegr
Date:     2009-08-18 12:49:34 +0000 (Tue, 18 Aug 2009)

Log Message:
-----------
Mapped some Sierra internal IDs to our own ones, and added a note about a hack currently used in the fallback detector

Modified Paths:
--------------
    scummvm/trunk/engines/sci/detection.cpp

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2009-08-18 12:28:46 UTC (rev 43508)
+++ scummvm/trunk/engines/sci/detection.cpp	2009-08-18 12:49:34 UTC (rev 43509)
@@ -3033,7 +3033,77 @@
 	const ADGameDescription *fallbackDetect(const Common::FSList &fslist) const;
 };
 
+Common::String convertSierraGameId(Common::String sierraId) {
+	// TODO: SCI32 IDs
 
+	// TODO: astrochicken
+	// TODO: The internal id of christmas1998 is "demo"
+	if (sierraId == "card")
+		return "christmas1990";
+	// TODO: christmas1992
+	if (sierraId == "arthur")
+		return "camelot";
+	if (sierraId == "brain")
+		return "castlebrain";
+	// iceman is the same
+	// longbow is the same
+	if (sierraId == "eco")
+		return "ecoquest";
+	if (sierraId == "rain")
+		return "ecoquest2";
+	if (sierraId == "fp")
+		return "freddypharkas";
+	if (sierraId == "emc")
+		return "funseeker";
+	if (sierraId == "cardgames")
+		return "hoyle1";
+	if (sierraId == "solitare")
+		return "hoyle2";
+	// TODO: hoyle3
+	// TODO: hoyle4
+	if (sierraId == "kq1")
+		return "kq1sci";
+	if (sierraId == "kq4")
+		return "kq4sci";
+	if (sierraId == "lsl1")
+		return "lsl1sci";
+	// lsl2 is the same
+	// lsl3 is the same
+	// lsl5 is the same
+	// lsl6 is the same
+	// TODO: lslcasino
+	// TODO: fairytales
+	// TODO: mothergoose
+	// TODO: msastrochicken
+	if (sierraId == "cb1")
+		return "laurabow";
+	if (sierraId == "lb2")
+		return "laurabow2";
+	// TODO: lb2 floppy (its resources can't be read)
+	if (sierraId == "twisty")
+		return "pepper";
+	// TODO: pq1sci (its resources can't be read)
+	if (sierraId == "pq")
+		return "pq2";
+	// pq3 is the same
+	if (sierraId == "glory")
+		return "qfg1";
+	// TODO: qfg1 VGA (its resources can't be read)
+	if (sierraId == "trial")
+		return "qfg2";
+	if (sierraId == "qfg1")
+		return "qfg3";
+	// TODO: slater
+	if (sierraId == "sq1")
+		return "sq1sci";
+	// sq3 is the same
+	// sq4 is the same
+	// sq5 is the same
+	// TODO: islandbrain
+
+	return sierraId;
+}
+
 const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fslist) const {
 	bool foundResMap = false;
 	bool foundRes000 = false;
@@ -3049,8 +3119,13 @@
 		filename.toLowercase();
 
 		if (filename.contains("resource.map") || filename.contains("resmap.000")) {
-			// resource.map is located in the same directory as the other resource files,
+			// HACK: resource.map is located in the same directory as the other resource files,
 			// therefore add the directory here, so that the game files can be opened later on
+			// TODO/FIXME: This should be removed, as it will cause problems with game detection:
+			// if we got a game A, and then try to detect another game B, adding a default
+			// directory here means that game A's files will be opened first. We either need to
+			// remove the directory added here, or rewrite all the functions which access game
+			// files
 			Common::File::addDefaultDirectory(file->getParent().getPath());
 			foundResMap = true;
 		}
@@ -3104,9 +3179,7 @@
 	Common::String gameName = obj_get_name(segManager,version, game_obj);
 	debug(2, " \"%s\" at %04x:%04x", gameName.c_str(), PRINT_REG(game_obj));
 	gameName.toLowercase();
-	// TODO: Sierra's game IDs are not always the same as our own ones, we need to map them
-	// accordingly here
-	s_fallbackDesc.desc.gameid = strdup(gameName.c_str());
+	s_fallbackDesc.desc.gameid = strdup(convertSierraGameId(gameName).c_str());
 	delete kernel;
 	delete segManager;
 	delete resMgr;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list