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

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Jun 15 12:59:23 CEST 2010


Revision: 49788
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49788&view=rev
Author:   sev
Date:     2010-06-15 10:59:23 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
AdvancedDetector: Add new parameter directoryGlobs.

Without this parameter mass detection gave tons of false alarms.
Use globbing for narrowing down the depth search.

Modified Paths:
--------------
    scummvm/trunk/engines/advancedDetector.cpp
    scummvm/trunk/engines/advancedDetector.h
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agos/detection.cpp
    scummvm/trunk/engines/cine/detection.cpp
    scummvm/trunk/engines/cruise/detection.cpp
    scummvm/trunk/engines/draci/detection.cpp
    scummvm/trunk/engines/drascula/detection.cpp
    scummvm/trunk/engines/gob/detection.cpp
    scummvm/trunk/engines/groovie/detection.cpp
    scummvm/trunk/engines/kyra/detection.cpp
    scummvm/trunk/engines/lure/detection.cpp
    scummvm/trunk/engines/m4/detection.cpp
    scummvm/trunk/engines/made/detection.cpp
    scummvm/trunk/engines/mohawk/detection.cpp
    scummvm/trunk/engines/parallaction/detection.cpp
    scummvm/trunk/engines/saga/detection.cpp
    scummvm/trunk/engines/sci/detection.cpp
    scummvm/trunk/engines/teenagent/detection.cpp
    scummvm/trunk/engines/tinsel/detection.cpp
    scummvm/trunk/engines/touche/detection.cpp
    scummvm/trunk/engines/tucker/detection.cpp

Modified: scummvm/trunk/engines/advancedDetector.cpp
===================================================================
--- scummvm/trunk/engines/advancedDetector.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/advancedDetector.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -341,7 +341,7 @@
 
 static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams &params);
 
-static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth) {
+static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles, int depth, const char **directoryGlobs) {
 	if (depth <= 0)
 		return;
 
@@ -354,10 +354,23 @@
 		if (file->isDirectory()) {
 			Common::FSList files;
 
+			if (!directoryGlobs)
+				continue;
+
+			bool matched = false;
+			for (const char *glob = *directoryGlobs; *glob; glob++)
+				if (file->getName().matchString(glob, true)) {
+					matched = true;
+					break;
+				}
+					
+			if (!matched)
+				continue;
+
 			if (!file->getChildren(files, Common::FSNode::kListAll))
 				continue;
 
-			composeFileHashMap(files, allFiles, depth - 1);
+			composeFileHashMap(files, allFiles, depth - 1, directoryGlobs);
 		}
 
 		Common::String tstr = file->getName();
@@ -385,7 +398,7 @@
 
 	// First we compose a hashmap of all files in fslist.
 	// Includes nifty stuff like removing trailing dots and ignoring case.
-	composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth));
+	composeFileHashMap(fslist, allFiles, (params.depth == 0 ? 1 : params.depth), params.directoryGlobs);
 
 	// Check which files are included in some ADGameDescription *and* present
 	// in fslist. Compute MD5s and file sizes for these files.

Modified: scummvm/trunk/engines/advancedDetector.h
===================================================================
--- scummvm/trunk/engines/advancedDetector.h	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/advancedDetector.h	2010-06-15 10:59:23 UTC (rev 49788)
@@ -192,11 +192,19 @@
 	uint32 guioptions;
 
 	/**
-	 *
 	 * Maximum depth of directories to look up
 	 * If set to 0, the depth is 1 level
 	 */
 	uint32 depth;
+
+	/**
+	 * Case-insensitive list of directory globs which could be used for
+	 * going deeper int directory structure.
+	 * @see String::matchString() method for format description.
+	 *
+	 * @note Last item must be 0
+	 */
+	const char **directoryGlobs;
 };
 
 

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/agi/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -147,7 +147,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOSPEECH,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 using namespace Agi;

Modified: scummvm/trunk/engines/agos/detection.cpp
===================================================================
--- scummvm/trunk/engines/agos/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/agos/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -104,7 +104,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOLAUNCHLOAD,
 	// Maximum directory depth
-	2
+	2,
+	// List of directory globs
+	0
 };
 
 using namespace AGOS;

Modified: scummvm/trunk/engines/cine/detection.cpp
===================================================================
--- scummvm/trunk/engines/cine/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/cine/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -82,7 +82,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class CineMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/cruise/detection.cpp
===================================================================
--- scummvm/trunk/engines/cruise/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/cruise/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -239,7 +239,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOSPEECH | Common::GUIO_NOMIDI,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class CruiseMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/draci/detection.cpp
===================================================================
--- scummvm/trunk/engines/draci/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/draci/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -96,7 +96,9 @@
 	// Global GUI options
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class DraciMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/drascula/detection.cpp
===================================================================
--- scummvm/trunk/engines/drascula/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/drascula/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -266,7 +266,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOMIDI,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class DrasculaMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/gob/detection.cpp
===================================================================
--- scummvm/trunk/engines/gob/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/gob/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -109,7 +109,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOLAUNCHLOAD,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class GobMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/groovie/detection.cpp
===================================================================
--- scummvm/trunk/engines/groovie/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/groovie/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -178,7 +178,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 

Modified: scummvm/trunk/engines/kyra/detection.cpp
===================================================================
--- scummvm/trunk/engines/kyra/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/kyra/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -63,7 +63,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class KyraMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/lure/detection.cpp
===================================================================
--- scummvm/trunk/engines/lure/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/lure/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -198,7 +198,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOSPEECH,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class LureMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/m4/detection.cpp
===================================================================
--- scummvm/trunk/engines/m4/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/m4/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -402,7 +402,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOMIDI,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class M4MetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/made/detection.cpp
===================================================================
--- scummvm/trunk/engines/made/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/made/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -495,7 +495,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class MadeMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/mohawk/detection.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/mohawk/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -143,7 +143,9 @@
 	// Additional GUI options (for every game)
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	2
+	2,
+	// List of directory globs
+	0
 };
 
 class MohawkMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/parallaction/detection.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/parallaction/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -242,7 +242,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NOLAUNCHLOAD,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class ParallactionMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/saga/detection.cpp
===================================================================
--- scummvm/trunk/engines/saga/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/saga/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -124,7 +124,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class SagaMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/sci/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -312,7 +312,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class SciMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/teenagent/detection.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/teenagent/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -92,7 +92,8 @@
 	0,
 	0,
 	Common::GUIO_NONE,
-	1
+	1,
+	0
 };
 
 #define MAX_SAVES 20

Modified: scummvm/trunk/engines/tinsel/detection.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/tinsel/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -97,7 +97,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class TinselMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/touche/detection.cpp
===================================================================
--- scummvm/trunk/engines/touche/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/touche/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -136,7 +136,9 @@
 	// Additional GUI options (for every game}
 	Common::GUIO_NONE,
 	// Maximum directory depth
-	1
+	1,
+	// List of directory globs
+	0
 };
 
 class ToucheMetaEngine : public AdvancedMetaEngine {

Modified: scummvm/trunk/engines/tucker/detection.cpp
===================================================================
--- scummvm/trunk/engines/tucker/detection.cpp	2010-06-15 10:57:47 UTC (rev 49787)
+++ scummvm/trunk/engines/tucker/detection.cpp	2010-06-15 10:59:23 UTC (rev 49788)
@@ -115,7 +115,8 @@
 	0,
 	0,
 	Common::GUIO_NONE,
-	1
+	1,
+	0
 };
 
 static const ADGameDescription tuckerDemoGameDescription = {


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