[Scummvm-cvs-logs] SF.net SVN: scummvm:[49656] scummvm/trunk/engines/scumm/detection.cpp
sev at users.sourceforge.net
sev at users.sourceforge.net
Mon Jun 14 16:51:46 CEST 2010
Revision: 49656
http://scummvm.svn.sourceforge.net/scummvm/?rev=49656&view=rev
Author: sev
Date: 2010-06-14 14:51:46 +0000 (Mon, 14 Jun 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
scummvm/trunk/engines/scumm/detection.cpp
Modified: scummvm/trunk/engines/scumm/detection.cpp
===================================================================
--- scummvm/trunk/engines/scumm/detection.cpp 2010-06-14 14:51:18 UTC (rev 49655)
+++ scummvm/trunk/engines/scumm/detection.cpp 2010-06-14 14:51:46 UTC (rev 49656)
@@ -381,20 +381,37 @@
}
}
-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()) {
DetectorDesc d;
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) {
// If a gameid was specified, we only try to detect that specific game,
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