aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/detection
diff options
context:
space:
mode:
authorBastien Bouclet2017-12-02 17:14:22 +0100
committerBastien Bouclet2018-05-10 09:04:23 +0200
commitcf1ebf29516bd74927fd7b632b72fd8973f72e98 (patch)
treee928c3c13903db53bc7badc9ea4eb98741d9d58d /engines/gob/detection
parent9587dd5c21d388616dc8d42db909390fab384c2f (diff)
downloadscummvm-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/gob/detection')
-rw-r--r--engines/gob/detection/detection.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index e204ced1e8..487b65f4a8 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -35,7 +35,7 @@ public:
virtual GameDescriptor findGame(const char *gameId) const;
- virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const;
+ ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override;
virtual const char *getName() const;
virtual const char *getOriginalCopyright() const;
@@ -63,25 +63,22 @@ GameDescriptor GobMetaEngine::findGame(const char *gameId) const {
return Engines::findGameID(gameId, _gameIds, obsoleteGameIDsTable);
}
-const ADGameDescription *GobMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
- ADFilePropertiesMap filesProps;
+ADDetectedGame GobMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
+ ADDetectedGame detectedGame = detectGameFilebased(allFiles, fslist, Gob::fileBased);
+ if (!detectedGame.desc) {
+ return ADDetectedGame();
+ }
- const Gob::GOBGameDescription *game;
- game = (const Gob::GOBGameDescription *)detectGameFilebased(allFiles, fslist, Gob::fileBased, &filesProps);
- if (!game)
- return 0;
+ const Gob::GOBGameDescription *game = (const Gob::GOBGameDescription *)detectedGame.desc;
if (game->gameType == Gob::kGameTypeOnceUponATime) {
game = detectOnceUponATime(fslist);
- if (!game)
- return 0;
+ if (game) {
+ detectedGame.desc = &game->desc;
+ }
}
- ADGameIdList gameIds;
- gameIds.push_back(game->desc.gameId);
-
- reportUnknown(fslist.begin()->getParent(), filesProps, gameIds);
- return (const ADGameDescription *)game;
+ return detectedGame;
}
const Gob::GOBGameDescription *GobMetaEngine::detectOnceUponATime(const Common::FSList &fslist) {