diff options
| -rw-r--r-- | engines/advancedDetector.cpp | 19 | ||||
| -rw-r--r-- | engines/advancedDetector.h | 10 | ||||
| -rw-r--r-- | engines/agi/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/agos/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/cine/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/cruise/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/draci/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/drascula/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/gob/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/groovie/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/kyra/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/lure/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/m4/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/made/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/mohawk/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/parallaction/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/saga/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/sci/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/teenagent/detection.cpp | 3 | ||||
| -rw-r--r-- | engines/tinsel/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/touche/detection.cpp | 4 | ||||
| -rw-r--r-- | engines/tucker/detection.cpp | 3 | 
22 files changed, 83 insertions, 24 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index ee0c5c7c62..974970ff0f 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -341,7 +341,7 @@ static void reportUnknown(const Common::FSNode &path, const SizeMD5Map &filesSiz  static ADGameDescList detectGameFilebased(const FileMap &allFiles, const ADParams ¶ms); -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 @@ static void composeFileHashMap(const Common::FSList &fslist, FileMap &allFiles,  		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 @@ static ADGameDescList detectGame(const Common::FSList &fslist, const ADParams &p  	// 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. diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index a48dd0c1d2..de4fc3bbf8 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -192,11 +192,19 @@ struct ADParams {  	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;  }; diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index aa4d368fca..d1bed5d716 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -147,7 +147,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOSPEECH,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  using namespace Agi; diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index 9a23dde426..cec2db2c10 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -104,7 +104,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOLAUNCHLOAD,  	// Maximum directory depth -	2 +	2, +	// List of directory globs +	0  };  using namespace AGOS; diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp index bcc4951140..b92ad8a0a2 100644 --- a/engines/cine/detection.cpp +++ b/engines/cine/detection.cpp @@ -82,7 +82,9 @@ static const ADParams detectionParams = {  	// 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 { diff --git a/engines/cruise/detection.cpp b/engines/cruise/detection.cpp index 9088b8261e..e43fadf598 100644 --- a/engines/cruise/detection.cpp +++ b/engines/cruise/detection.cpp @@ -239,7 +239,9 @@ static const ADParams detectionParams = {  	// 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 { diff --git a/engines/draci/detection.cpp b/engines/draci/detection.cpp index 39834ab5fa..e1025e698a 100644 --- a/engines/draci/detection.cpp +++ b/engines/draci/detection.cpp @@ -96,7 +96,9 @@ const ADParams detectionParams = {  	// Global GUI options  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class DraciMetaEngine : public AdvancedMetaEngine { diff --git a/engines/drascula/detection.cpp b/engines/drascula/detection.cpp index a0781e0bff..c10222cadd 100644 --- a/engines/drascula/detection.cpp +++ b/engines/drascula/detection.cpp @@ -266,7 +266,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOMIDI,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class DrasculaMetaEngine : public AdvancedMetaEngine { diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 3d83f12e39..a1eb8055aa 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -109,7 +109,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOLAUNCHLOAD,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class GobMetaEngine : public AdvancedMetaEngine { diff --git a/engines/groovie/detection.cpp b/engines/groovie/detection.cpp index 1f7156b2fc..b30c2361d2 100644 --- a/engines/groovie/detection.cpp +++ b/engines/groovie/detection.cpp @@ -178,7 +178,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOSUBTITLES | Common::GUIO_NOSFX,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  }; diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp index 4ed314934d..f3e6c7c8cc 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -63,7 +63,9 @@ const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class KyraMetaEngine : public AdvancedMetaEngine { diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index d8c7b483f8..dd2a702e2a 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -198,7 +198,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOSPEECH,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class LureMetaEngine : public AdvancedMetaEngine { diff --git a/engines/m4/detection.cpp b/engines/m4/detection.cpp index 80a899f1ac..4b204996f3 100644 --- a/engines/m4/detection.cpp +++ b/engines/m4/detection.cpp @@ -402,7 +402,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOMIDI,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class M4MetaEngine : public AdvancedMetaEngine { diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index 081bb98006..dd2becd3b8 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -495,7 +495,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class MadeMetaEngine : public AdvancedMetaEngine { diff --git a/engines/mohawk/detection.cpp b/engines/mohawk/detection.cpp index a01f4a8759..9c3154a8bd 100644 --- a/engines/mohawk/detection.cpp +++ b/engines/mohawk/detection.cpp @@ -143,7 +143,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game)  	Common::GUIO_NONE,  	// Maximum directory depth -	2 +	2, +	// List of directory globs +	0  };  class MohawkMetaEngine : public AdvancedMetaEngine { diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index 2ecaf1c2d6..e00a087923 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -242,7 +242,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NOLAUNCHLOAD,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class ParallactionMetaEngine : public AdvancedMetaEngine { diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index b57b056806..7913291527 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -124,7 +124,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class SagaMetaEngine : public AdvancedMetaEngine { diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index b402f7cc0b..7163c879b1 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -312,7 +312,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class SciMetaEngine : public AdvancedMetaEngine { diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index 4c61e20b7a..a2dab9658d 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -92,7 +92,8 @@ static const ADParams detectionParams = {  	0,  	0,  	Common::GUIO_NONE, -	1 +	1, +	0  };  #define MAX_SAVES 20 diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index c46a93fb38..d6bdad6032 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -97,7 +97,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class TinselMetaEngine : public AdvancedMetaEngine { diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 72f87a2f3f..f336c2e008 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -136,7 +136,9 @@ static const ADParams detectionParams = {  	// Additional GUI options (for every game}  	Common::GUIO_NONE,  	// Maximum directory depth -	1 +	1, +	// List of directory globs +	0  };  class ToucheMetaEngine : public AdvancedMetaEngine { diff --git a/engines/tucker/detection.cpp b/engines/tucker/detection.cpp index 7f88a8ff2f..0a9dec9b46 100644 --- a/engines/tucker/detection.cpp +++ b/engines/tucker/detection.cpp @@ -115,7 +115,8 @@ static const ADParams detectionParams = {  	0,  	0,  	Common::GUIO_NONE, -	1 +	1, +	0  };  static const ADGameDescription tuckerDemoGameDescription = {  | 
