diff options
author | Bastien Bouclet | 2017-12-02 17:14:22 +0100 |
---|---|---|
committer | Bastien Bouclet | 2018-05-10 09:04:23 +0200 |
commit | cf1ebf29516bd74927fd7b632b72fd8973f72e98 (patch) | |
tree | e928c3c13903db53bc7badc9ea4eb98741d9d58d /engines/tinsel | |
parent | 9587dd5c21d388616dc8d42db909390fab384c2f (diff) | |
download | scummvm-rg350-cf1ebf29516bd74927fd7b632b72fd8973f72e98.tar.gz scummvm-rg350-cf1ebf29516bd74927fd7b632b72fd8973f72e98.tar.bz2 scummvm-rg350-cf1ebf29516bd74927fd7b632b72fd8973f72e98.zip |
ENGINES: Add unknown game variants to the game detector results
Diffstat (limited to 'engines/tinsel')
-rw-r--r-- | engines/tinsel/detection.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp index d6bcfe5ea0..1c60c5eb8a 100644 --- a/engines/tinsel/detection.cpp +++ b/engines/tinsel/detection.cpp @@ -97,7 +97,7 @@ public: } virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; - const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; + ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override; virtual bool hasFeature(MetaEngineFeature f) const; virtual SaveStateList listSaves(const char *target) const; @@ -185,7 +185,7 @@ typedef Common::Array<const ADGameDescription *> ADGameDescList; * Fallback detection scans the list of Discworld 2 targets to see if it can detect an installation * where the files haven't been renamed (i.e. don't have the '1' just before the extension) */ -const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFilesXXX, const Common::FSList &fslist) const { +ADDetectedGame TinselMetaEngine::fallbackDetect(const FileMap &allFilesXXX, const Common::FSList &fslist) const { Common::String extra; FileMap allFiles; SizeMD5Map filesSizeMD5; @@ -194,7 +194,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile const Tinsel::TinselGameDescription *g; if (fslist.empty()) - return NULL; + return ADDetectedGame(); // TODO: The following code is essentially a slightly modified copy of the // complete code of function detectGame() in engines/advancedDetector.cpp. @@ -262,7 +262,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile } } - ADGameDescList matched; + ADDetectedGame matched; int maxFilesMatched = 0; // MD5 based matching @@ -310,22 +310,15 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile for (fileDesc = g->desc.filesDescriptions; fileDesc->fileName; fileDesc++) curFilesMatched++; - if (curFilesMatched > maxFilesMatched) { + if (curFilesMatched >= maxFilesMatched) { maxFilesMatched = curFilesMatched; - matched.clear(); // Remove any prior, lower ranked matches. - matched.push_back((const ADGameDescription *)g); - } else if (curFilesMatched == maxFilesMatched) { - matched.push_back((const ADGameDescription *)g); + matched = ADDetectedGame(&g->desc); } } } - // We didn't find a match - if (matched.empty()) - return NULL; - - return *matched.begin(); + return matched; } int TinselMetaEngine::getMaximumSaveSlot() const { return 99; } |