aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
authorStrangerke2014-09-17 23:10:03 +0200
committerStrangerke2014-09-17 23:10:03 +0200
commit1769003a9b7158ab77afdf98c3c11f949e988ddf (patch)
treee5a07c8897ea6c32d3a395259806157c7eae31d7 /engines/cge2
parent9cb37636cff0bb0ae537c69281287479898515b5 (diff)
downloadscummvm-rg350-1769003a9b7158ab77afdf98c3c11f949e988ddf.tar.gz
scummvm-rg350-1769003a9b7158ab77afdf98c3c11f949e988ddf.tar.bz2
scummvm-rg350-1769003a9b7158ab77afdf98c3c11f949e988ddf.zip
CGE2: Implement fallbackDetect
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/detection.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/engines/cge2/detection.cpp b/engines/cge2/detection.cpp
index fa02d412f1..d93a090513 100644
--- a/engines/cge2/detection.cpp
+++ b/engines/cge2/detection.cpp
@@ -26,6 +26,7 @@
*/
#include "cge2/cge2.h"
+#include "cge2/fileio.h"
#include "engines/advancedDetector.h"
#include "common/translation.h"
#include "graphics/surface.h"
@@ -101,6 +102,7 @@ public:
return "Sfinx (c) 1994-1997 Janus B. Wisniewski and L.K. Avalon";
}
+ virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
virtual bool hasFeature(MetaEngineFeature f) const;
virtual int getMaximumSaveSlot() const;
@@ -109,6 +111,44 @@ 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 = {
+ "Sfinx",
+ "Unknown version",
+ AD_ENTRY1(0, 0), // This should always be AD_ENTRY1(0, 0) in the fallback descriptor
+ Common::UNK_LANG,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO1(GAMEOPTION_COLOR_BLIND_DEFAULT_OFF)
+};
+
+const ADGameDescription *CGE2MetaEngine::fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
+ ADFilePropertiesMap filesProps;
+
+ const ADGameDescription *game;
+ game = detectGameFilebased(allFiles, fslist, CGE2::fileBasedFallback, &filesProps);
+
+ if (!game)
+ return 0;
+
+ SearchMan.clear();
+ SearchMan.addDirectory(fslist.begin()->getParent().getPath(), fslist.begin()->getParent());
+ ResourceManager *resman;
+ resman = new ResourceManager();
+ bool result = resman->exist("CGE.SAY");
+ delete resman;
+
+ if (!result)
+ return 0;
+
+ reportUnknown(fslist.begin()->getParent(), filesProps);
+ return &s_fallbackDesc;
+}
+
bool CGE2MetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
if (desc)
*engine = new CGE2::CGE2Engine(syst, desc);