diff options
author | Colin Snover | 2017-05-21 15:31:37 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-21 15:56:42 -0500 |
commit | 159e5a97ce4f04eddd3d91a00aee2f3131b13a50 (patch) | |
tree | 7735077479553bbf1e2e05a419bce61dd36928ba /engines/advancedDetector.h | |
parent | fa0bb7dd5a60c8f323ecbd5e190ad705bec3e934 (diff) | |
download | scummvm-rg350-159e5a97ce4f04eddd3d91a00aee2f3131b13a50.tar.gz scummvm-rg350-159e5a97ce4f04eddd3d91a00aee2f3131b13a50.tar.bz2 scummvm-rg350-159e5a97ce4f04eddd3d91a00aee2f3131b13a50.zip |
ENGINES: Allow detection entries to match on full paths
This allows an engine to match files that exist multiple times
in the same game directory with the same basename.
For example, different releases of Torin's Passage in SCI engine
come with zero or more GERMAN, FRENCH, ENGLISH, etc. directories,
all containing files with the same basenames but with different
contents per language. Because the allFiles map used only the
basename of a file as a key, it could not match more than one of
these localization directories, which made it impossible to select
from all the possible languages.
Refs Trac#9772.
Diffstat (limited to 'engines/advancedDetector.h')
-rw-r--r-- | engines/advancedDetector.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index ab3ec22bdc..e218c41b52 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -251,6 +251,17 @@ protected: */ const char * const *_directoryGlobs; + /** + * If true, filenames will be matched against the entire path, relative to + * the root detection directory (e.g. "foo/bar.000" for a file at + * "<root>/foo/bar.000"). Otherwise, filenames only match the basename + * (e.g. "bar.000" for the same file). + * + * @note _maxScanDepth and _directoryGlobs must still be configured to allow + * the detector to find files inside subdirectories. + */ + bool _matchFullPaths; + public: AdvancedMetaEngine(const void *descs, uint descItemSize, const PlainGameDescriptor *gameIds, const ADExtraGuiOptionsMap *extraGuiOptions = 0); @@ -326,7 +337,7 @@ protected: * Compose a hashmap of all files in fslist. * Includes nifty stuff like removing trailing dots and ignoring case. */ - void composeFileHashMap(FileMap &allFiles, const Common::FSList &fslist, int depth) const; + void composeFileHashMap(FileMap &allFiles, const Common::FSList &fslist, int depth, const Common::String &parentName = Common::String()) const; /** Get the properties (size and MD5) of this file. */ bool getFileProperties(const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, ADFileProperties &fileProps) const; |