[Scummvm-cvs-logs] SF.net SVN: scummvm:[49798] scummvm/trunk/engines/scumm

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Jun 15 13:04:35 CEST 2010


Revision: 49798
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49798&view=rev
Author:   sev
Date:     2010-06-15 11:04:35 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
SCUMM: Added directory globs for in-depth search.

The code was compied from AdvancedDetector. Currently it is
set up to detect Mac indy3/loom which contains it data in
Rooms 1, Roooms 2 and Rooms 3 directories.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/detection.cpp
    scummvm/trunk/engines/scumm/detection_tables.h

Modified: scummvm/trunk/engines/scumm/detection.cpp
===================================================================
--- scummvm/trunk/engines/scumm/detection.cpp	2010-06-15 11:03:11 UTC (rev 49797)
+++ scummvm/trunk/engines/scumm/detection.cpp	2010-06-15 11:04:35 UTC (rev 49798)
@@ -381,7 +381,7 @@
 	}
 }
 
-static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map, int depth) {
+static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map, int depth, const char **globs) {
 	if (depth <= 0)
 		return;
 
@@ -395,10 +395,23 @@
 			d.md5Entry = 0;
 			fileMD5Map[file->getName()] = d;
 		} else {
+			if (!directoryGlobs)
+				continue;
+
+			bool matched = false;
+			for (const char *glob = *globs; *glob; glob++)
+				if (file->getName().matchString(glob, true)) {
+					matched = true;
+					break;
+				}
+					
+			if (!matched)
+				continue;
+
 			Common::FSList files;
 
 			if (file->getChildren(files, Common::FSNode::kListAll)) {
-				composeFileHashMap(files, fileMD5Map, depth - 1);
+				composeFileHashMap(files, fileMD5Map, depth - 1, directoryGlobs);
 			}
 		}
 	}
@@ -410,7 +423,7 @@
 	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);
+	composeFileHashMap(fslist, fileMD5Map, 2, directoryGlobs);
 
 	// Iterate over all filename patterns.
 	for (const GameFilenamePattern *gfp = gameFilenamesTable; gfp->gameid; ++gfp) {

Modified: scummvm/trunk/engines/scumm/detection_tables.h
===================================================================
--- scummvm/trunk/engines/scumm/detection_tables.h	2010-06-15 11:03:11 UTC (rev 49797)
+++ scummvm/trunk/engines/scumm/detection_tables.h	2010-06-15 11:04:35 UTC (rev 49798)
@@ -48,7 +48,16 @@
 #pragma mark --- Tables ---
 #pragma mark -
 
+/**
+ * This table contains list of directories which could contain game data
+ * and which should be looked into during detection.
+ */
+static const char *directoryGlobs[] = {
+	"rooms *",  // Mac version of indy3/loom
+	0
+};
 
+
 /**
  * This table contains all game IDs supported by the SCUMM engine, and maps
  * them to the full humand readable game name.


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