aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/detection.cpp')
-rw-r--r--engines/gob/detection.cpp46
1 files changed, 19 insertions, 27 deletions
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index be44c05bfb..9a554b5429 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -22,6 +22,7 @@
#include "base/plugins.h"
#include "engines/advancedDetector.h"
+#include "engines/obsolete.h"
#include "gob/gob.h"
@@ -78,7 +79,7 @@ static const PlainGameDescriptor gobGames[] = {
{0, 0}
};
-static const ADObsoleteGameID obsoleteGameIDsTable[] = {
+static const Engines::ObsoleteGameID obsoleteGameIDsTable[] = {
{"gob1", "gob", kPlatformUnknown},
{"gob2", "gob", kPlatformUnknown},
{0, 0, kPlatformUnknown}
@@ -86,34 +87,20 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
#include "gob/detection_tables.h"
-static const ADParams detectionParams = {
- // Pointer to ADGameDescription or its superset structure
- (const byte *)Gob::gameDescriptions,
- // Size of that superset structure
- sizeof(Gob::GOBGameDescription),
- // Number of bytes to compute MD5 sum for
- 5000,
- // List of all engine targets
- gobGames,
- // Structure for autoupgrading obsolete targets
- obsoleteGameIDsTable,
- // Name of single gameid (optional)
- "gob",
- // List of files for file-based fallback detection (optional)
- Gob::fileBased,
- // Flags
- 0,
- // Additional GUI options (for every game}
- Common::GUIO_NOLAUNCHLOAD,
- // Maximum directory depth
- 1,
- // List of directory globs
- 0
-};
-
class GobMetaEngine : public AdvancedMetaEngine {
public:
- GobMetaEngine() : AdvancedMetaEngine(detectionParams) {}
+ GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) {
+ _singleid = "gob";
+ _guioptions = Common::GUIO_NOLAUNCHLOAD;
+ }
+
+ virtual GameDescriptor findGame(const char *gameid) const {
+ return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable);
+ }
+
+ virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const {
+ return detectGameFilebased(allFiles, Gob::fileBased);
+ }
virtual const char *getName() const {
return "Gob";
@@ -124,6 +111,11 @@ public:
}
virtual bool hasFeature(MetaEngineFeature f) const;
+
+ virtual Common::Error createInstance(OSystem *syst, Engine **engine) const {
+ Engines::upgradeTargetIfNecessary(obsoleteGameIDsTable);
+ return AdvancedMetaEngine::createInstance(syst, engine);
+ }
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
};