aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/detection/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/detection/detection.cpp')
-rw-r--r--engines/gob/detection/detection.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/engines/gob/detection/detection.cpp b/engines/gob/detection/detection.cpp
index e204ced1e8..864a701aa6 100644
--- a/engines/gob/detection/detection.cpp
+++ b/engines/gob/detection/detection.cpp
@@ -33,9 +33,9 @@ class GobMetaEngine : public AdvancedMetaEngine {
public:
GobMetaEngine();
- virtual GameDescriptor findGame(const char *gameId) const;
+ PlainGameDescriptor findGame(const char *gameId) const override;
- 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;
@@ -59,29 +59,26 @@ GobMetaEngine::GobMetaEngine() :
_guiOptions = GUIO1(GUIO_NOLAUNCHLOAD);
}
-GameDescriptor GobMetaEngine::findGame(const char *gameId) const {
+PlainGameDescriptor 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) {