aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/advancedDetector.cpp20
-rw-r--r--common/advancedDetector.h11
2 files changed, 15 insertions, 16 deletions
diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp
index 5f2873126a..937f764ccb 100644
--- a/common/advancedDetector.cpp
+++ b/common/advancedDetector.cpp
@@ -417,13 +417,6 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
}
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 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
}
}
+ // 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 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
}
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");
+ }
}
}
diff --git a/common/advancedDetector.h b/common/advancedDetector.h
index 7640cf945a..df7468f58f 100644
--- a/common/advancedDetector.h
+++ b/common/advancedDetector.h
@@ -81,14 +81,14 @@ struct ADObsoleteGameID {
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 @@ enum ADFlags {
* 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
};
/**