From 9ba4a77a3bca5453698a73a0bf5f15c1a9ffb680 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 2 Feb 2023 18:23:28 +0100 Subject: [PATCH] AD: Set scan depth when adding globs generated from the entries. Default is 5 --- engines/advancedDetector.cpp | 3 ++- engines/advancedDetector.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 6f897eed8dd..18a602a71d6 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -461,7 +461,7 @@ Common::Error AdvancedMetaEngineDetection::createInstance(OSystem *syst, Engine Common::FSNode gameDataDir = Common::FSNode(ConfMan.get("path")); for (auto d = dirs.begin(); d != dirs.end(); ++d) - SearchMan.addSubDirectoryMatching(gameDataDir, *d); + SearchMan.addSubDirectoryMatching(gameDataDir, *d, 0, _fullPathGlobsDepth); } // Call child class's createInstanceMethod. @@ -867,6 +867,7 @@ AdvancedMetaEngineDetection::AdvancedMetaEngineDetection(const void *descs, uint _maxScanDepth = 1; _directoryGlobs = NULL; _maxAutogenLength = 15; + _fullPathGlobsDepth = 5; _hashMapsInited = false; diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 1c0b7af8e50..7deb5a1a20f 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -352,6 +352,13 @@ protected: */ int _maxAutogenLength; + /** + * If kADFlagMatchFullPaths is set, then use this value for specifying + * depth for addSubDirectoryMatching() call + * The default is 5; + */ + int _fullPathGlobsDepth; + public: /** * Initialize game detection using AdvancedMetaEngineDetection.