[Scummvm-cvs-logs] SF.net SVN: scummvm: [26029] scummvm/trunk/common

cyx at users.sourceforge.net cyx at users.sourceforge.net
Thu Mar 8 22:33:56 CET 2007


Revision: 26029
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26029&view=rev
Author:   cyx
Date:     2007-03-08 13:33:55 -0800 (Thu, 08 Mar 2007)

Log Message:
-----------
added a flag to enable/disable printing a warning when filename based detection find a match, also updated some comments.

Modified Paths:
--------------
    scummvm/trunk/common/advancedDetector.cpp
    scummvm/trunk/common/advancedDetector.h

Modified: scummvm/trunk/common/advancedDetector.cpp
===================================================================
--- scummvm/trunk/common/advancedDetector.cpp	2007-03-08 21:08:23 UTC (rev 26028)
+++ scummvm/trunk/common/advancedDetector.cpp	2007-03-08 21:33:55 UTC (rev 26029)
@@ -417,13 +417,6 @@
 	}
 
 	if (params.fileBasedFallback != 0) {
-		// The format of fileBasedFallback is like this:
-		// It points to an array of strings (char pointers), separated into
-		// multiple "rows".
-		// First comes a gameid, then follows a list of filenames that have
-		// to be present in order to generate a match; the row is terminated
-		// by a zero byte.
-		// The whole list is terminated by another zero byte (i.e. a zero gameid).
 		const ADFileBasedFallback *ptr = params.fileBasedFallback;
 		const char* const* filenames = 0;
 
@@ -448,6 +441,9 @@
 			}
 		}
 
+		// Then we perform the actual filename matching. If there are
+		// several matches, only the one with the maximum numbers of
+		// files is considered.
 		int maxNumMatchedFiles = 0;
 		const ADGameDescription *matchedDesc = 0;
 
@@ -490,11 +486,13 @@
 		}
 
 		if (matchedDesc) { // We got a match
-			// FIXME: This warning, if ever seen by somebody, is
-			// extremly cryptic!
-			warning("But it looks like unknown variant of %s", matchedDesc->gameid);
-
 			matched.push_back(matchedDesc);
+			if (params.flags & kADFlagPrintWarningOnFileBasedFallback) {
+				printf("Your game version has been detected using filename matching as a\n");
+				printf("variant of %s.\n", matchedDesc->gameid);
+				printf("If this is an original and unmodified version, please report any\n");
+				printf("information previously printed by ScummVM to the team.\n");
+			}
 		}
 	}
 

Modified: scummvm/trunk/common/advancedDetector.h
===================================================================
--- scummvm/trunk/common/advancedDetector.h	2007-03-08 21:08:23 UTC (rev 26028)
+++ scummvm/trunk/common/advancedDetector.h	2007-03-08 21:33:55 UTC (rev 26029)
@@ -81,14 +81,14 @@
 
 struct ADFileBasedFallback {
 	/**
-	 * Pointer to an ADGameDescription or subclass thereof.
+	 * Pointer to an ADGameDescription or subclass thereof which will get
+	 * returned if there's a detection match.
 	 */
 	const void *desc;
 	
 	/**
-	 * A zero-terminated list of filenames.
-	 *
-	 * @todo Properly explain this
+	 * A zero-terminated list of filenames used for matching. All files in
+	 * the list must be present to get a detection match.
 	 */
 	const char *filenames[10];
 };
@@ -100,7 +100,8 @@
 	 * not equal to english) and platform (if not equal to PC).
 	 */
 	kADFlagAugmentPreferredTarget = (1 << 0),
-	kADFlagFilebasedFallback = (1 << 1)  // Use file based fallback detection
+	kADFlagPrintWarningOnFileBasedFallback = (1 << 1),
+	kADFlagFilebasedFallback = (1 << 2)  // Use file based fallback detection
 };
 
 /**


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