aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2008-11-04 16:11:40 +0000
committerMax Horn2008-11-04 16:11:40 +0000
commit61aadb378d654425d55b8cf9f91df4283b46de7e (patch)
treec087a5576ecc7f707abd68c596cf5d0955708e91 /engines
parent70679e68951789f70f57a8b900b51b3cf52979b1 (diff)
downloadscummvm-rg350-61aadb378d654425d55b8cf9f91df4283b46de7e.tar.gz
scummvm-rg350-61aadb378d654425d55b8cf9f91df4283b46de7e.tar.bz2
scummvm-rg350-61aadb378d654425d55b8cf9f91df4283b46de7e.zip
Fixed the EngineFeature vs. MetaEngineFeature mess, clarified some EngineFeature comments
svn-id: r34896
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/agi.h9
-rw-r--r--engines/agi/detection.cpp5
-rw-r--r--engines/agos/agos.h13
-rw-r--r--engines/agos/detection.cpp6
-rw-r--r--engines/cine/cine.h7
-rw-r--r--engines/cine/detection.cpp6
-rw-r--r--engines/dialogs.cpp16
-rw-r--r--engines/engine.cpp21
-rw-r--r--engines/engine.h76
-rw-r--r--engines/gob/detection.cpp5
-rw-r--r--engines/gob/gob.h8
-rw-r--r--engines/kyra/detection.cpp8
-rw-r--r--engines/kyra/kyra_v1.h8
-rw-r--r--engines/lure/detection.cpp6
-rw-r--r--engines/lure/lure.h4
-rw-r--r--engines/metaengine.h19
-rw-r--r--engines/parallaction/detection.cpp6
-rw-r--r--engines/parallaction/parallaction.h9
-rw-r--r--engines/queen/queen.cpp8
-rw-r--r--engines/queen/queen.h11
-rw-r--r--engines/saga/detection.cpp8
-rw-r--r--engines/saga/saga.h12
-rw-r--r--engines/scumm/detection.cpp5
-rw-r--r--engines/scumm/scumm.h3
-rw-r--r--engines/sky/sky.cpp6
-rw-r--r--engines/sky/sky.h9
-rw-r--r--engines/sword1/sword1.cpp6
-rw-r--r--engines/sword1/sword1.h9
-rw-r--r--engines/sword2/sword2.cpp6
-rw-r--r--engines/sword2/sword2.h12
-rw-r--r--engines/touche/detection.cpp6
-rw-r--r--engines/touche/touche.h2
32 files changed, 193 insertions, 142 deletions
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index ff2b05ace1..a1edcb2ad0 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -696,7 +696,8 @@ struct StringData {
class AgiBase : public ::Engine {
protected:
// Engine API
- int init();
+ virtual int init();
+ virtual bool hasFeature(EngineFeature f) const;
virtual void initialize() = 0;
@@ -743,7 +744,10 @@ class AgiEngine : public AgiBase {
int _gameId;
protected:
- int go();
+ // Engine APIs
+ virtual int go();
+ virtual void syncSoundSettings();
+
void initialize();
uint32 _lastSaveTime;
@@ -755,7 +759,6 @@ public:
return _gameId;
}
- virtual void syncSoundSettings();
private:
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp
index e82d4877e7..1f3ba18bc4 100644
--- a/engines/agi/detection.cpp
+++ b/engines/agi/detection.cpp
@@ -2132,12 +2132,15 @@ public:
bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave);
}
+bool AgiBase::hasFeature(EngineFeature f) const {
+ return (f == kSupportsRTL);
+}
+
bool AgiMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Agi::AGIGameDescription *gd = (const Agi::AGIGameDescription *)desc;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 49b4478ec7..4d1349b942 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -163,7 +163,13 @@ class AGOSEngine : public Engine {
friend class Debugger;
friend class MoviePlayer;
- GUI::Debugger *getDebugger();
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual GUI::Debugger *getDebugger();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void syncSoundSettings();
+ virtual void pauseEngineIntern(bool pause);
public:
virtual void setupOpcodes();
@@ -588,7 +594,6 @@ protected:
void loadSoundFile(const char *filename);
- virtual void syncSoundSettings();
int getUserFlag(Item *item, int a);
int getUserFlag1(Item *item, int a);
@@ -1147,9 +1152,6 @@ protected:
void loadVGAVideoFile(uint16 id, uint8 type);
bool loadVGASoundFile(uint16 id, uint8 type);
- int init();
- int go();
-
void openGameFile();
void readGameFile(void *dst, uint32 offs, uint32 size);
@@ -1210,7 +1212,6 @@ protected:
void checkTimerCallback();
void delay(uint delay);
void pause();
- virtual void pauseEngineIntern(bool pause);
void waitForMark(uint i);
void scrollScreen();
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 6cc4d16044..6a022ac44a 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -118,10 +118,14 @@ public:
bool AgosMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves);
}
+bool AGOS::AGOSEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const AGOS::AGOSGameDescription *gd = (const AGOS::AGOSGameDescription *)desc;
bool res = true;
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index 6011036eb1..ef643a115e 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -70,8 +70,11 @@ typedef Common::HashMap<Common::String, const char *> StringPtrHashMap;
class CineEngine : public Engine {
protected:
- int init();
- int go();
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual bool hasFeature(EngineFeature f) const;
+
void shutdown();
bool initGame();
diff --git a/engines/cine/detection.cpp b/engines/cine/detection.cpp
index f6aaede6b7..156cbaa805 100644
--- a/engines/cine/detection.cpp
+++ b/engines/cine/detection.cpp
@@ -540,11 +540,15 @@ public:
bool CineMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup);
}
+bool Cine::CineEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
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/dialogs.cpp b/engines/dialogs.cpp
index 962e0857c6..0650896199 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -99,13 +99,11 @@ MainMenuDialog::MainMenuDialog(Engine *engine)
_loadButton = new GUI::ButtonWidget(this, "GlobalMenu.Load", "Load", kLoadCmd, 'L');
// TODO: setEnabled -> setVisible
- _loadButton->setEnabled(_engine->hasFeature(Engine::kSupportsListSaves) &&
- _engine->hasFeature(Engine::kSupportsLoadingDuringRuntime));
+ _loadButton->setEnabled(_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime));
_saveButton = new GUI::ButtonWidget(this, "GlobalMenu.Save", "Save", kSaveCmd, 'S');
// TODO: setEnabled -> setVisible
- _saveButton->setEnabled(_engine->hasFeature(Engine::kSupportsListSaves) &&
- _engine->hasFeature(Engine::kSupportsSavingDuringRuntime));
+ _saveButton->setEnabled(_engine->hasFeature(Engine::kSupportsSavingDuringRuntime));
new GUI::ButtonWidget(this, "GlobalMenu.Options", "Options", kOptionsCmd, 'O');
@@ -197,12 +195,10 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
}
void MainMenuDialog::reflowLayout() {
- if (_engine->hasFeature(Engine::kSupportsListSaves)) {
- if (_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime))
- _loadButton->setEnabled(_engine->canLoadGameStateCurrently());
- if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime))
- _saveButton->setEnabled(_engine->canSaveGameStateCurrently());
- }
+ if (_engine->hasFeature(Engine::kSupportsLoadingDuringRuntime))
+ _loadButton->setEnabled(_engine->canLoadGameStateCurrently());
+ if (_engine->hasFeature(Engine::kSupportsSavingDuringRuntime))
+ _saveButton->setEnabled(_engine->canSaveGameStateCurrently());
#ifndef DISABLE_FANCY_THEMES
if (g_gui.xmlEval()->getVar("Globals.ShowGlobalMenuLogo", 0) == 1 && g_gui.theme()->supportsImages()) {
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 7c251cbe1f..e6a8e51b4c 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -286,27 +286,14 @@ bool Engine::shouldQuit() const {
return (_eventMan->shouldQuit() || _eventMan->shouldRTL());
}
-bool Engine::hasFeature(EngineFeature f) {
- // TODO: Get rid of this hack!!!
- if (f != kSupportsRTL && f != kSupportsListSaves &&
- f != kSupportsLoadingDuringRuntime &&
- f != kSupportsSavingDuringRuntime)
- return false;
+/*
+EnginePlugin *Engine::getMetaEnginePlugin() const {
const EnginePlugin *plugin = 0;
Common::String gameid = ConfMan.get("gameid");
gameid.toLowercase();
EngineMan.findGame(gameid, &plugin);
- assert(plugin);
- if (f == kSupportsRTL)
- return (*plugin)->hasFeature(MetaEngine::kSupportsRTL);
- else if (f == kSupportsListSaves)
- return (*plugin)->hasFeature(MetaEngine::kSupportsListSaves);
- else if (f == kSupportsLoadingDuringRuntime)
- return (*plugin)->hasFeature(MetaEngine::kSupportsLoadingDuringRuntime);
- else if (f == kSupportsSavingDuringRuntime)
- return (*plugin)->hasFeature(MetaEngine::kSupportsSavingDuringRuntime);
- else
- return false;
+ return plugin;
}
+*/
diff --git a/engines/engine.h b/engines/engine.h
index b8904d56c4..5267eec792 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -83,6 +83,39 @@ private:
public:
+
+ /**
+ * A feature in this context means an ability of the engine which can be
+ * either available or not.
+ * @see Engine::hasFeature()
+ */
+ enum EngineFeature {
+ /**
+ * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled
+ * either directly, or indirectly (that is, the engine calls and honors
+ * the result of the Engine::shouldQuit() method appropriately).
+ */
+ kSupportsRTL,
+
+ /**
+ * Loading savestates during runtime is supported, that is, this engine
+ * implements loadGameState() and canLoadGameStateCurrently().
+ * If this feature is supported, then the corresponding MetaEngine *must*
+ * support the kSupportsListSaves feature.
+ */
+ kSupportsLoadingDuringRuntime,
+
+ /**
+ * Loading savestates during runtime is supported, that is, this engine
+ * implements saveGameState() and canSaveGameStateCurrently().
+ * If this feature is supported, then the corresponding MetaEngine *must*
+ * support the kSupportsListSaves feature.
+ */
+ kSupportsSavingDuringRuntime
+ };
+
+
+
/** @name Overloadable methods
*
* All Engine subclasses should consider overloading some or all of the following methods.
@@ -118,6 +151,13 @@ public:
virtual GUI::Debugger *getDebugger() { return 0; }
/**
+ * Determine whether the engine supports the specified feature.
+ */
+ virtual bool hasFeature(EngineFeature f) const { return false; }
+
+// virtual EnginePlugin *getMetaEnginePlugin() const;
+
+ /**
* Notify the engine that the sound settings in the config manager may have
* changed and that it hence should adjust any internal volume etc. values
* accordingly.
@@ -199,42 +239,6 @@ public:
*/
void openMainMenuDialog();
-
- /**
- * A feature in this context means an ability of the engine which can be
- * either available or not.
- */
- enum EngineFeature {
- /**
- * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled.
- */
- kSupportsRTL = 0,
-
- /**
- * Listing all Save States for a given target is supported, i.e.,
- * the listSaves() method is implemented.
- * Used for --list-saves support, as well as the GMM load dialog.
- */
- kSupportsListSaves = 1,
-
- /**
- * Loading from the in-game common ScummVM options dialog is supported
- */
- kSupportsLoadingDuringRuntime = 8,
-
- /**
- * Saving from the in-game common ScummVM options dialog is supported
- */
- kSupportsSavingDuringRuntime = 9
- };
-
- /**
- * Determine whether the engine supports the specified feature.
- *
- * @todo Let this return false by default, or even turn it into a pure virtual method.
- */
- bool hasFeature(EngineFeature f);
-
public:
/** On some systems, check if the game appears to be run from CD. */
diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp
index c871bdb976..8b7929e953 100644
--- a/engines/gob/detection.cpp
+++ b/engines/gob/detection.cpp
@@ -2134,10 +2134,13 @@ public:
};
bool GobMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return false;
+}
+
+bool Gob::GobEngine::hasFeature(EngineFeature f) const {
return
(f == kSupportsRTL);
}
-
bool GobMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Gob::GOBGameDescription *gd = (const Gob::GOBGameDescription *)desc;
if (gd) {
diff --git a/engines/gob/gob.h b/engines/gob/gob.h
index 39950e3261..599d7085fb 100644
--- a/engines/gob/gob.h
+++ b/engines/gob/gob.h
@@ -190,10 +190,12 @@ private:
uint32 _pauseStart;
- int go();
- int init();
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void pauseEngineIntern(bool pause);
- void pauseEngineIntern(bool pause);
bool initGameParts();
void deinitGameParts();
diff --git a/engines/kyra/detection.cpp b/engines/kyra/detection.cpp
index 8b859c62e1..0d4f8244ac 100644
--- a/engines/kyra/detection.cpp
+++ b/engines/kyra/detection.cpp
@@ -1073,12 +1073,16 @@ public:
bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave) ||
(f == kSavesSupportMetaInfo) ||
- (f == kSavesSupportThumbnail) ||
+ (f == kSavesSupportThumbnail);
+}
+
+bool Kyra::KyraEngine_v1::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL) ||
(f == kSupportsLoadingDuringRuntime);
}
diff --git a/engines/kyra/kyra_v1.h b/engines/kyra/kyra_v1.h
index 114536c381..81eea7420c 100644
--- a/engines/kyra/kyra_v1.h
+++ b/engines/kyra/kyra_v1.h
@@ -114,9 +114,6 @@ public:
KyraEngine_v1(OSystem *system, const GameFlags &flags);
virtual ~KyraEngine_v1();
- ::GUI::Debugger *getDebugger();
-
- virtual void pauseEngineIntern(bool pause);
uint8 game() const { return _flags.gameID; }
const GameFlags &gameFlags() const { return _flags; }
@@ -170,8 +167,11 @@ public:
virtual void delayWithTicks(int ticks);
protected:
- virtual int go() = 0;
+ // Engine APIs
virtual int init();
+ virtual ::GUI::Debugger *getDebugger();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void pauseEngineIntern(bool pause);
// intern
Resource *_res;
diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp
index 7e74eee026..7c0715e694 100644
--- a/engines/lure/detection.cpp
+++ b/engines/lure/detection.cpp
@@ -193,12 +193,16 @@ public:
bool LureMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave);
}
+bool Lure::LureEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
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/lure/lure.h b/engines/lure/lure.h
index 2c1a70329e..a1e1448e0f 100644
--- a/engines/lure/lure.h
+++ b/engines/lure/lure.h
@@ -69,10 +69,12 @@ public:
~LureEngine();
static LureEngine &getReference();
+ // Engine APIs
virtual int init();
virtual int go();
- virtual void pauseEngineIntern(bool pause);
+ virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
+ virtual void pauseEngineIntern(bool pause);
Disk &disk() { return *_disk; }
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 6eebc04d9c..24995cd41b 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -134,11 +134,6 @@ public:
*/
enum MetaEngineFeature {
/**
- * 'Return to launcher' feature is supported, i.e., EVENT_RTL is handled.
- */
- kSupportsRTL,
-
- /**
* Listing all Save States for a given target is supported, i.e.,
* the listSaves() method is implemented.
* Used for --list-saves support, as well as the GMM load dialog.
@@ -183,18 +178,8 @@ public:
* the game till the save.
* This flag may only be set when 'kSavesSupportMetaInfo' is set.
*/
- kSavesSupportPlayTime,
-
- /**
- * Features loading from the Common ScummVM options dialog in-game.
- */
- kSupportsLoadingDuringRuntime,
-
- /**
- * Features saving from the Common ScummVM options dialog in-game.
- */
- kSupportsSavingDuringRuntime
- };
+ kSavesSupportPlayTime
+ };
/**
* Determine whether the engine supports the specified MetaEngine feature.
diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp
index d219c0c00f..d64f50b620 100644
--- a/engines/parallaction/detection.cpp
+++ b/engines/parallaction/detection.cpp
@@ -252,12 +252,16 @@ public:
bool ParallactionMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave);
}
+bool Parallaction::Parallaction::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
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/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index d7add635cd..b1baa28530 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -227,7 +227,9 @@ public:
Parallaction(OSystem *syst, const PARALLACTIONGameDescription *gameDesc);
~Parallaction();
- int init();
+ // Engine APIs
+ virtual int init();
+ virtual bool hasFeature(EngineFeature f) const;
// info
int32 _screenWidth;
@@ -360,8 +362,9 @@ public:
Parallaction_ns(OSystem* syst, const PARALLACTIONGameDescription *gameDesc) : Parallaction(syst, gameDesc) { }
~Parallaction_ns();
- int init();
- int go();
+ // Engine APIs
+ virtual int init();
+ virtual int go();
public:
virtual void parseLocation(const char *filename);
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index 9fc30e0d62..961154e5ac 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -23,8 +23,6 @@
*
*/
-
-
#include "base/plugins.h"
#include "common/config-manager.h"
@@ -80,12 +78,16 @@ const char *QueenMetaEngine::getCopyright() const {
bool QueenMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave);
}
+bool Queen::QueenEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
GameList QueenMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(queenGameDescriptor);
diff --git a/engines/queen/queen.h b/engines/queen/queen.h
index 01d6340abb..dcfc7b07a5 100644
--- a/engines/queen/queen.h
+++ b/engines/queen/queen.h
@@ -97,7 +97,6 @@ public:
void checkOptionSettings();
void readOptionSettings();
void writeOptionSettings();
- virtual void syncSoundSettings();
int talkSpeed() const { return _talkSpeed; }
void talkSpeed(int speed) { _talkSpeed = speed; }
@@ -129,10 +128,12 @@ public:
protected:
- GUI::Debugger *getDebugger();
-
- int go();
- int init();
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual GUI::Debugger *getDebugger();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void syncSoundSettings();
int _talkSpeed;
diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp
index e26cf48dcb..3f67d4dc70 100644
--- a/engines/saga/detection.cpp
+++ b/engines/saga/detection.cpp
@@ -156,10 +156,14 @@ public:
bool SagaMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
- (f == kSupportsDeleteSave) ||
+ (f == kSupportsDeleteSave);
+}
+
+bool Saga::SagaEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL) ||
(f == kSupportsLoadingDuringRuntime) ||
(f == kSupportsSavingDuringRuntime);
}
diff --git a/engines/saga/saga.h b/engines/saga/saga.h
index 5417217065..86c91c2f3a 100644
--- a/engines/saga/saga.h
+++ b/engines/saga/saga.h
@@ -486,9 +486,13 @@ inline uint16 objectIndexToId(int type, int index) {
class SagaEngine : public Engine {
friend class Scene;
-protected:
- int go();
- int init();
+public:
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void syncSoundSettings();
+
public:
SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc);
virtual ~SagaEngine();
@@ -512,8 +516,6 @@ public:
return isSaveListFull() ? _saveFilesCount : _saveFilesCount + 1;
}
- virtual void syncSoundSettings();
-
int16 _framesEsc;
uint32 _globalFlags;
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index fd8ccc8955..31f957e6b1 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -691,7 +691,6 @@ public:
bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave) ||
@@ -701,6 +700,10 @@ bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
(f == kSavesSupportPlayTime);
}
+bool ScummEngine::hasFeature(EngineFeature f) const {
+ return (f == kSupportsRTL);
+}
+
GameList ScummMetaEngine::getSupportedGames() const {
return GameList(gameDescriptions);
}
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index ec733d32f4..0ee4302c8b 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -447,6 +447,8 @@ public:
virtual int go();
virtual void errorString(const char *buf_input, char *buf_output);
virtual GUI::Debugger *getDebugger();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void syncSoundSettings();
virtual void pauseEngineIntern(bool pause);
protected:
@@ -462,7 +464,6 @@ protected:
virtual void loadLanguageBundle() {}
void loadCJKFont();
void setupMusic(int midi);
- virtual void syncSoundSettings();
void setTalkDelay(int talkdelay);
int getTalkDelay();
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 0f126450fb..605d7b6e04 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -130,11 +130,15 @@ const char *SkyMetaEngine::getCopyright() const {
bool SkyMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup);
}
+bool Sky::SkyEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
GameList SkyMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(skySetting);
diff --git a/engines/sky/sky.h b/engines/sky/sky.h
index 47aebaba77..f3d2e564c8 100644
--- a/engines/sky/sky.h
+++ b/engines/sky/sky.h
@@ -58,7 +58,6 @@ class Debugger;
class SkyCompact;
class SkyEngine : public Engine {
- GUI::Debugger *getDebugger();
protected:
Common::KeyState _keyPressed;
bool _floppyIntro;
@@ -89,15 +88,19 @@ public:
static SystemVars _systemVars;
protected:
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual GUI::Debugger *getDebugger();
+ virtual bool hasFeature(EngineFeature f) const;
+
byte _fastMode;
void delay(int32 amount);
- int go();
void handleKey(void);
uint32 _lastSaveTime;
- int init();
void initItemList();
void initVirgin();
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index 8cbd549c75..6e5420787b 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -106,11 +106,15 @@ public:
bool SwordMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup);
}
+bool Sword1::SwordEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
GameList SwordMetaEngine::getSupportedGames() const {
GameList games;
games.push_back(sword1FullSettings);
diff --git a/engines/sword1/sword1.h b/engines/sword1/sword1.h
index 5bc80b4f6d..8397f30705 100644
--- a/engines/sword1/sword1.h
+++ b/engines/sword1/sword1.h
@@ -77,12 +77,15 @@ public:
virtual ~SwordEngine();
static SystemVars _systemVars;
void reinitialize(void);
- virtual void syncSoundSettings();
uint32 _features;
protected:
- int go();
- int init();
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void syncSoundSettings();
+
private:
void delay(int32 amount);
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index e0c95c7120..eba8edaf91 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -92,12 +92,16 @@ public:
bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave);
}
+bool Sword2::Sword2Engine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
GameList Sword2MetaEngine::getSupportedGames() const {
const Sword2::GameSettings *g = Sword2::sword2_settings;
GameList games;
diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h
index 9b589c347e..06d6292ec2 100644
--- a/engines/sword2/sword2.h
+++ b/engines/sword2/sword2.h
@@ -113,8 +113,6 @@ private:
uint32 calcChecksum(byte *buffer, uint32 size);
- virtual void pauseEngineIntern(bool pause);
-
uint32 _totalStartups;
uint32 _totalScreenManagers;
uint32 _startRes;
@@ -127,8 +125,13 @@ private:
public:
Sword2Engine(OSystem *syst);
~Sword2Engine();
- int go();
- int init();
+
+ // Engine APIs
+ virtual int init();
+ virtual int go();
+ virtual GUI::Debugger *getDebugger();
+ virtual bool hasFeature(EngineFeature f) const;
+ virtual void pauseEngineIntern(bool pause);
int getFramesPerSecond();
@@ -212,7 +215,6 @@ public:
void sleepUntil(uint32 time);
- GUI::Debugger *getDebugger();
void initialiseFontResourceFlags();
void initialiseFontResourceFlags(uint8 language);
diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp
index dfcda985ab..fae051ad30 100644
--- a/engines/touche/detection.cpp
+++ b/engines/touche/detection.cpp
@@ -145,12 +145,16 @@ public:
bool ToucheMetaEngine::hasFeature(MetaEngineFeature f) const {
return
- (f == kSupportsRTL) ||
(f == kSupportsListSaves) ||
(f == kSupportsLoadingDuringStartup) ||
(f == kSupportsDeleteSave);
}
+bool Touche::ToucheEngine::hasFeature(EngineFeature f) const {
+ return
+ (f == kSupportsRTL);
+}
+
bool ToucheMetaEngine::createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const {
const Common::ADGameDescription *gd = desc;
if (gd) {
diff --git a/engines/touche/touche.h b/engines/touche/touche.h
index 707eedbb38..a5ff67dcc9 100644
--- a/engines/touche/touche.h
+++ b/engines/touche/touche.h
@@ -361,8 +361,10 @@ public:
ToucheEngine(OSystem *system, Common::Language language);
virtual ~ToucheEngine();
+ // Engine APIs
virtual int init();
virtual int go();
+ virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
protected: