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/scumm | |
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/scumm')
-rw-r--r-- | engines/scumm/detection.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 9573db55cd..fccb30b0fa 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -959,9 +959,9 @@ public: virtual const char *getOriginalCopyright() const; virtual bool hasFeature(MetaEngineFeature f) const; - virtual GameList getSupportedGames() const; - virtual GameDescriptor findGame(const char *gameid) const; - virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const; + PlainGameList getSupportedGames() const override; + PlainGameDescriptor findGame(const char *gameid) const override; + virtual DetectedGames detectGames(const Common::FSList &fslist) const override; virtual Common::Error createInstance(OSystem *syst, Engine **engine) const; @@ -992,11 +992,11 @@ bool ScummEngine::hasFeature(EngineFeature f) const { (f == kSupportsSubtitleOptions); } -GameList ScummMetaEngine::getSupportedGames() const { - return GameList(gameDescriptions); +PlainGameList ScummMetaEngine::getSupportedGames() const { + return PlainGameList(gameDescriptions); } -GameDescriptor ScummMetaEngine::findGame(const char *gameid) const { +PlainGameDescriptor ScummMetaEngine::findGame(const char *gameid) const { return Engines::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable); } @@ -1026,29 +1026,26 @@ static Common::String generatePreferredTarget(const DetectorResult &x) { return res; } -GameList ScummMetaEngine::detectGames(const Common::FSList &fslist, bool /*useUnknownGameDialog*/) const { - GameList detectedGames; +DetectedGames ScummMetaEngine::detectGames(const Common::FSList &fslist) const { + DetectedGames detectedGames; Common::List<DetectorResult> results; - ::detectGames(fslist, results, 0); for (Common::List<DetectorResult>::iterator x = results.begin(); x != results.end(); ++x) { const PlainGameDescriptor *g = findPlainGameDescriptor(x->game.gameid, gameDescriptions); assert(g); - GameDescriptor dg(x->game.gameid, g->description, x->language, x->game.platform); - // Append additional information, if set, to the description. - dg.updateDesc(x->extra); + DetectedGame game = DetectedGame(x->game.gameid, g->description, x->language, x->game.platform, x->extra); // Compute and set the preferred target name for this game. // Based on generateComplexID() in advancedDetector.cpp. - dg["preferredtarget"] = generatePreferredTarget(*x); + game.preferredTarget = generatePreferredTarget(*x); - dg.setGUIOptions(x->game.guioptions + MidiDriver::musicType2GUIO(x->game.midi)); - dg.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(x->language)); + game.setGUIOptions(x->game.guioptions + MidiDriver::musicType2GUIO(x->game.midi)); + game.appendGUIOptions(getGameGUIOptionsDescriptionLanguage(x->language)); - detectedGames.push_back(dg); + detectedGames.push_back(game); } return detectedGames; |