diff options
author | Bastien Bouclet | 2017-12-02 17:14:22 +0100 |
---|---|---|
committer | Bastien Bouclet | 2018-05-10 09:04:23 +0200 |
commit | cf1ebf29516bd74927fd7b632b72fd8973f72e98 (patch) | |
tree | e928c3c13903db53bc7badc9ea4eb98741d9d58d /engines/cge | |
parent | 9587dd5c21d388616dc8d42db909390fab384c2f (diff) | |
download | scummvm-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/cge')
-rw-r--r-- | engines/cge/detection.cpp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/engines/cge/detection.cpp b/engines/cge/detection.cpp index 4c23939d60..f6399d484c 100644 --- a/engines/cge/detection.cpp +++ b/engines/cge/detection.cpp @@ -126,7 +126,7 @@ public: return "Soltys (C) 1994-1996 L.K. Avalon"; } - virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const; + ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const override; virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; virtual int getMaximumSaveSlot() const; @@ -135,13 +135,8 @@ public: virtual void removeSaveState(const char *target, int slot) const; }; -static const ADFileBasedFallback fileBasedFallback[] = { - { &gameDescriptions[0], { "vol.cat", "vol.dat", 0 } }, - { 0, { 0 } } -}; - static ADGameDescription s_fallbackDesc = { - "Soltys", + "soltys", "Unknown version", AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor Common::UNK_LANG, @@ -150,28 +145,29 @@ static ADGameDescription s_fallbackDesc = { GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF) }; -const ADGameDescription *CGEMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { - ADFilePropertiesMap filesProps; +static const ADFileBasedFallback fileBasedFallback[] = { + { &s_fallbackDesc, { "vol.cat", "vol.dat", 0 } }, + { 0, { 0 } } +}; - const ADGameDescription *game; - game = detectGameFilebased(allFiles, fslist, CGE::fileBasedFallback, &filesProps); +ADDetectedGame CGEMetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { + ADDetectedGame game = detectGameFilebased(allFiles, fslist, CGE::fileBasedFallback); - if (!game) - return nullptr; + if (!game.desc) + return ADDetectedGame(); SearchMan.addDirectory("CGEMetaEngine::fallbackDetect", fslist.begin()->getParent()); ResourceManager *resman; resman = new ResourceManager(); - bool result = resman->exist("CGE.SAY"); + bool sayFileFound = resman->exist("CGE.SAY"); delete resman; SearchMan.remove("CGEMetaEngine::fallbackDetect"); - if (!result) - return nullptr; + if (!sayFileFound) + return ADDetectedGame(); - reportUnknown(fslist.begin()->getParent(), filesProps); - return &s_fallbackDesc; + return game; } bool CGEMetaEngine::hasFeature(MetaEngineFeature f) const { |