aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-14 14:51:46 +0000
committerEugene Sandulenko2010-06-14 14:51:46 +0000
commitca161920a4dcf26a6d8773dec5d95141b0383df2 (patch)
tree371b89ee549222efec8260d7ff719a2bd7aecddd
parente281f2599a8ad608b61be3a7129f951223cad9f6 (diff)
downloadscummvm-rg350-ca161920a4dcf26a6d8773dec5d95141b0383df2.tar.gz
scummvm-rg350-ca161920a4dcf26a6d8773dec5d95141b0383df2.tar.bz2
scummvm-rg350-ca161920a4dcf26a6d8773dec5d95141b0383df2.zip
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
-rw-r--r--engines/scumm/detection.cpp25
1 files 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<DetectorResult> &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::List<DetectorResul
d.node = *file;
d.md5Entry = 0;
fileMD5Map[file->getName()] = 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<DetectorResult> &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) {