From 75ae7cdb730859838097aec1374cad81d9040ec6 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 14 Feb 2007 00:21:53 +0000 Subject: Properly implemented the AD fallback callback svn-id: r25576 --- common/advancedDetector.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'common/advancedDetector.cpp') diff --git a/common/advancedDetector.cpp b/common/advancedDetector.cpp index 54576fdfa7..242d1b8238 100644 --- a/common/advancedDetector.cpp +++ b/common/advancedDetector.cpp @@ -33,8 +33,6 @@ namespace Common { -typedef Array ADGameDescList; - namespace AdvancedDetector { /** @@ -344,9 +342,10 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p ADGameDescList matched; int maxFilesMatched = 0; + const ADGameDescription *g; for (i = 0; i < gameDescriptions.size(); i++) { - const ADGameDescription *g = gameDescriptions[i]; + g = gameDescriptions[i]; fileMissing = false; // Do not even bother to look at entries which do not have matching @@ -511,24 +510,25 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p if (matchEntry) { // We got a match for (i = 0; i < gameDescriptions.size(); i++) { - if (gameDescriptions[i]->filesDescriptions[0].fileName == 0) { - if (!scumm_stricmp(gameDescriptions[i]->gameid, *matchEntry)) { + g = gameDescriptions[i]; + if (g->filesDescriptions[0].fileName == 0) { + if (!scumm_stricmp(g->gameid, *matchEntry)) { // FIXME: This warning, if ever seen by somebody, is // extremly cryptic! warning("But it looks like unknown variant of %s", *matchEntry); - matched.push_back(gameDescriptions[i]); + matched.push_back(g); } } } } } -/* + // If we still haven't got a match, try to use the fallback callback :-) if (matched.empty() && params.fallbackDetectFunc != 0) { matched = (*params.fallbackDetectFunc)(fslist); } -*/ + return matched; } -- cgit v1.2.3