aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorChristopher Page2008-08-15 18:15:14 +0000
committerChristopher Page2008-08-15 18:15:14 +0000
commit9d3cdcb2da64ae3afdcd19f1ea18a917f9318190 (patch)
tree2d49249deec6d26bd875a5bbe1e8b8a3946bfec7 /engines
parent5bc5855ae9148672b242bd99f3faf5e7ede93ac8 (diff)
downloadscummvm-rg350-9d3cdcb2da64ae3afdcd19f1ea18a917f9318190.tar.gz
scummvm-rg350-9d3cdcb2da64ae3afdcd19f1ea18a917f9318190.tar.bz2
scummvm-rg350-9d3cdcb2da64ae3afdcd19f1ea18a917f9318190.zip
Defined some MetaEngineFeatures for the engines, the launcher uses these features to allow/disallow loading and deleting saves
svn-id: r33909
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/detection.cpp10
-rw-r--r--engines/cine/detection.cpp7
-rw-r--r--engines/kyra/detection.cpp13
-rw-r--r--engines/lure/detection.cpp8
-rw-r--r--engines/metaengine.h2
-rw-r--r--engines/parallaction/detection.cpp8
-rw-r--r--engines/queen/queen.cpp8
-rw-r--r--engines/saga/detection.cpp8
-rw-r--r--engines/scumm/detection.cpp18
-rw-r--r--engines/sky/sky.cpp9
-rw-r--r--engines/sword1/sword1.cpp7
-rw-r--r--engines/sword2/sword2.cpp8
-rw-r--r--engines/touche/detection.cpp8
13 files changed, 100 insertions, 14 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index 8ddeae1b17..5427879f20 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -2122,11 +2122,21 @@ public:
return "Sierra AGI Engine (C) Sierra On-Line Software";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
virtual SaveStateList listSaves(const char *target) const;
+
const Common::ADGameDescription *fallbackDetect(const FSList *fslist) const;
};
+bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
+
bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Agi::AGIGameDescription *gd = (const Agi::AGIGameDescription *)desc;
bool res = true;
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index 1dc6f89c49..28a8404d28 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -533,9 +533,16 @@ public:
}
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual SaveStateList listSaves(const char *target) const;
};
+bool CineMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad);
+}
+
bool CineMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Cine::CINEGameDescription *gd = (const Cine::CINEGameDescription *)desc;
if (gd) {
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index f8aa44be63..5ed556cc27 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -931,11 +931,18 @@ public:
return "The Legend of Kyrandia (C) Westwood Studios";
}
- bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
-
- SaveStateList listSaves(const char *target) const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
+ virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
+ virtual SaveStateList listSaves(const char *target) const;
};
+bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
bool KyraMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const KYRAGameDescription *gd = (const KYRAGameDescription *)desc;
bool res = true;
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index 8ed2e62760..dc23e4ad89 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -185,10 +185,18 @@ public:
return "Lure of the Temptress (C) Revolution";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
virtual SaveStateList listSaves(const char *target) const;
};
+bool LureMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
bool LureMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Lure::LureGameDescription *gd = (const Lure::LureGameDescription *)desc;
if (gd) {
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 0d8a4a15c9..15024ff661 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -126,7 +126,7 @@ public:
/**
* Determine whether the engine supports the specified feature
*/
- virtual bool hasFeature(MetaEngineFeature f) { return false; };
+ virtual bool hasFeature(MetaEngineFeature f) const { return false; };
//@}
};
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index 531bd8ee16..a65fc05b95 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -243,10 +243,18 @@ public:
return "Nippon Safes Inc. (C) Dynabyte";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
virtual SaveStateList listSaves(const char *target) const;
};
+bool ParallactionMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
bool ParallactionMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Parallaction::PARALLACTIONGameDescription *gd = (const Parallaction::PARALLACTIONGameDescription *)desc;
bool res = true;
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index 593597ce12..801a1c630a 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -60,6 +60,7 @@ public:
virtual const char *getName() const;
virtual const char *getCopyright() const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
virtual GameList detectGames(const FSList &fslist) const;
@@ -76,6 +77,13 @@ const char *QueenMetaEngine::getCopyright() const {
return "Flight of the Amazon Queen (C) John Passfield and Steve Stamatiadis";
}
+bool QueenMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
GameList QueenMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(queenGameDescriptor);
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index 3ed3882b06..16ac3d7fb4 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -147,10 +147,18 @@ public:
return "Inherit the Earth (C) Wyrmkeep Entertainment";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
virtual SaveStateList listSaves(const char *target) const;
};
+bool SagaMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
bool SagaMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Saga::SAGAGameDescription *gd = (const Saga::SAGAGameDescription *)desc;
if (gd) {
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 716a456c90..8d93b04a14 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -674,16 +674,23 @@ public:
virtual const char *getName() const;
virtual const char *getCopyright() const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
virtual GameList detectGames(const FSList &fslist) const;
- virtual bool hasFeature(MetaEngineFeature f);
-
+
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
virtual SaveStateList listSaves(const char *target) const;
};
+bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
GameList ScummMetaEngine::getSupportedGames() const {
return GameList(gameDescriptions);
}
@@ -692,13 +699,6 @@ GameDescriptor ScummMetaEngine::findGame(const char *gameid) const {
return Common::AdvancedDetector::findGameID(gameid, gameDescriptions, obsoleteGameIDsTable);
}
-bool ScummMetaEngine::hasFeature(MetaEngineFeature f) {
- return
- (f == kSupportsListSaves) ||
- (f == kSupportsDirectLoad) ||
- (f == kSupportsDeleteSave);
-}
-
GameList ScummMetaEngine::detectGames(const FSList &fslist) const {
GameList detectedGames;
Common::List<DetectorResult> results;
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index bcdc9f5130..88f7f93d75 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -110,9 +110,10 @@ public:
virtual const char *getName() const;
virtual const char *getCopyright() const;
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const FSList &fslist) const;
+ virtual GameList detectGames(const FSList &fslist) const;
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
@@ -127,6 +128,12 @@ const char *SkyMetaEngine::getCopyright() const {
return "Beneath a Steel Sky (C) Revolution";
}
+bool SkyMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad);
+}
+
GameList SkyMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(skySetting);
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 8bfb5d8698..de346a42dc 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -95,6 +95,7 @@ public:
return "Broken Sword Games (C) Revolution";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
virtual GameList detectGames(const FSList &fslist) const;
@@ -103,6 +104,12 @@ public:
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
};
+bool SwordMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad);
+}
+
GameList SwordMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(sword1FullSettings);
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 3b6f51050b..110d881c1d 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -80,6 +80,7 @@ public:
return "Broken Sword Games (C) Revolution";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
virtual GameList detectGames(const FSList &fslist) const;
@@ -88,6 +89,13 @@ public:
virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
};
+bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
GameList Sword2MetaEngine::getSupportedGames() const {
const Sword2::GameSettings *g = Sword2::sword2_settings;
GameList games;
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index 63d2a3a078..c4c428ba8d 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -136,10 +136,18 @@ public:
return "Touche: The Adventures of the 5th Musketeer (C) Clipper Software";
}
+ virtual bool hasFeature(MetaEngineFeature f) const;
virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const;
virtual SaveStateList listSaves(const char *target) const;
};
+bool ToucheMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ (f == kSupportsDirectLoad) ||
+ (f == kSupportsDeleteSave);
+}
+
bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Common::ADGameDescription *gd = desc;
if (gd) {