From ca161920a4dcf26a6d8773dec5d95141b0383df2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 14 Jun 2010 14:51:46 +0000 Subject: SCUMM: Fix bug #1438631. Bug #1438631: "SCUMM: Detecting mac version of indy3/loom broken" fixed by implementing recursive directory lookup similar to what was done for AdvancedDetector, since SCUMM engine does not use it. svn-id: r49656 --- engines/scumm/detection.cpp | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 7275caaa1e..d8b758c8b2 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -381,10 +381,12 @@ static void computeGameSettingsFromMD5(const Common::FSList &fslist, const GameF } } -static void detectGames(const Common::FSList &fslist, Common::List &results, const char *gameid) { - DescMap fileMD5Map; - DetectorResult dr; - char md5str[32+1]; +static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map, int depth) { + if (depth <= 0) + return; + + if (fslist.empty()) + return; for (Common::FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) { if (!file->isDirectory()) { @@ -392,8 +394,23 @@ static void detectGames(const Common::FSList &fslist, Common::ListgetName()] = d; + } else { + Common::FSList files; + + if (file->getChildren(files, Common::FSNode::kListAll)) { + composeFileHashMap(files, fileMD5Map, depth - 1); + } } } +} + +static void detectGames(const Common::FSList &fslist, Common::List &results, const char *gameid) { + DescMap fileMD5Map; + DetectorResult dr; + char md5str[32+1]; + + // Dive one level down since mac indy3/loom has its files split into directories. See Bug #1438631 + composeFileHashMap(fslist, fileMD5Map, 2); // Iterate over all filename patterns. for (const GameFilenamePattern *gfp = gameFilenamesTable; gfp->gameid; ++gfp) { -- cgit v1.2.3