From cf1ebf29516bd74927fd7b632b72fd8973f72e98 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 2 Dec 2017 17:14:22 +0100 Subject: ENGINES: Add unknown game variants to the game detector results --- engines/gob/detection/detection.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'engines/gob') 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) { -- cgit v1.2.3