aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorMax Horn2011-06-14 15:25:33 +0200
committerMax Horn2011-06-14 18:52:07 +0200
commit593b929047434eefa9b6dfb73730f7d502c4ff10 (patch)
tree84fcfdd28ec336bf00f2969ff545e5a686ebd98d /engines/gob
parent6412d091268d299f7f4d31382b0e4e9e4e352ad9 (diff)
downloadscummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.tar.gz
scummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.tar.bz2
scummvm-rg350-593b929047434eefa9b6dfb73730f7d502c4ff10.zip
DETECTOR: Separate code for handling obsolete gameids from advanced detector
This includes a renaming of ADObsoleteGameID to Engine::ObsoleteGameID, and AdvancedDetector::findGameID now is Engines::findGameID. Doxygen comments were added or improved
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/detection.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index e30380a5a5..2050539d60 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}
@@ -89,12 +90,15 @@ static const ADObsoleteGameID obsoleteGameIDsTable[] = {
class GobMetaEngine : public AdvancedMetaEngine {
public:
GobMetaEngine() : AdvancedMetaEngine(Gob::gameDescriptions, sizeof(Gob::GOBGameDescription), gobGames) {
- _obsoleteList = obsoleteGameIDsTable;
_singleid = "gob";
_fileBasedFallback = Gob::fileBased;
_guioptions = Common::GUIO_NOLAUNCHLOAD;
}
+ virtual GameDescriptor findGame(const char *gameid) const {
+ return Engines::findGameID(gameid, _gameids, obsoleteGameIDsTable);
+ }
+
virtual const char *getName() const {
return "Gob";
}
@@ -104,6 +108,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;
};