diff options
author | Bastien Bouclet | 2018-05-28 18:43:15 +0200 |
---|---|---|
committer | GitHub | 2018-05-28 18:43:15 +0200 |
commit | 61f9398b04a4bce397a8be6ae96491a2015a6da2 (patch) | |
tree | 478c127f74b21365255b31d11e455bfdbb463244 /engines/sludge | |
parent | 8d654285cbf0bf6423676244c89833557f811e38 (diff) | |
parent | 1dcb8076db64420ab28722a73583f89b38314e71 (diff) | |
download | scummvm-rg350-61f9398b04a4bce397a8be6ae96491a2015a6da2.tar.gz scummvm-rg350-61f9398b04a4bce397a8be6ae96491a2015a6da2.tar.bz2 scummvm-rg350-61f9398b04a4bce397a8be6ae96491a2015a6da2.zip |
Merge pull request #1187 from bgK/detection-refactor-unknown
ENGINES: Return unknown game variants with the list of detected games
Diffstat (limited to 'engines/sludge')
-rw-r--r-- | engines/sludge/detection.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/sludge/detection.cpp b/engines/sludge/detection.cpp index 361d44b1e1..8c5c0ac13d 100644 --- a/engines/sludge/detection.cpp +++ b/engines/sludge/detection.cpp @@ -100,10 +100,10 @@ public: } // for fall back detection - virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; + ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override; }; -const ADGameDescription *SludgeMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { +ADDetectedGame SludgeMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { // reset fallback description s_fallbackDesc.desc.gameId = "sludge"; s_fallbackDesc.desc.extra = ""; @@ -147,9 +147,19 @@ const ADGameDescription *SludgeMetaEngine::fallbackDetect(const FileMap &allFile s_fallbackFileNameBuffer[50] = '\0'; s_fallbackDesc.desc.filesDescriptions[0].fileName = s_fallbackFileNameBuffer; - return (const ADGameDescription *)&s_fallbackDesc; + ADDetectedGame game; + game.desc = &s_fallbackDesc.desc; + + FileProperties tmp; + if (getFileProperties(file->getParent(), allFiles, s_fallbackDesc.desc, fileName, tmp)) { + game.hasUnknownFiles = true; + game.matchedFiles[fileName] = tmp; + } + + return game; } - return 0; + + return ADDetectedGame(); } #if PLUGIN_ENABLED_DYNAMIC(SLUDGE) |