ENGINES: Make AdvancedMetaEngine::toDetectedGame virtual

To allow subclasses to post-process the games detected by
AdvancedMetaEngine.
This commit is contained in:
Bastien Bouclet 2020-06-05 19:43:03 +02:00
parent bad365c97e
commit 675776ffe9
2 changed files with 4 additions and 8 deletions

View file

@ -289,15 +289,11 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
if (!agdDesc.desc) if (!agdDesc.desc)
return Common::kNoGameDataFoundError; return Common::kNoGameDataFoundError;
DetectedGame gameDescriptor = toDetectedGame(agdDesc);
// If the GUI options were updated, we catch this here and update them in the users config // If the GUI options were updated, we catch this here and update them in the users config
// file transparently. // file transparently.
Common::String lang = getGameGUIOptionsDescriptionLanguage(agdDesc.desc->language); ConfMan.setAndFlush("guioptions", gameDescriptor.getGUIOptions());
if (agdDesc.desc->flags & ADGF_ADDENGLISH)
lang += " " + getGameGUIOptionsDescriptionLanguage(Common::EN_ANY);
Common::updateGameGUIOptions(agdDesc.desc->guiOptions + _guiOptions, lang);
DetectedGame gameDescriptor = toDetectedGame(agdDesc);
bool showTestingWarning = false; bool showTestingWarning = false;

View file

@ -317,7 +317,7 @@ protected:
bool getFileProperties(const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, FileProperties &fileProps) const; bool getFileProperties(const Common::FSNode &parent, const FileMap &allFiles, const ADGameDescription &game, const Common::String fname, FileProperties &fileProps) const;
/** Convert an AD game description into the shared game description format */ /** Convert an AD game description into the shared game description format */
DetectedGame toDetectedGame(const ADDetectedGame &adGame) const; virtual DetectedGame toDetectedGame(const ADDetectedGame &adGame) const;
}; };
#endif #endif