diff options
-rw-r--r-- | engines/agi/detection.cpp | 1 | ||||
-rw-r--r-- | engines/agos/detection.cpp | 1 | ||||
-rw-r--r-- | engines/dialogs.cpp | 12 | ||||
-rw-r--r-- | engines/dialogs.h | 1 | ||||
-rw-r--r-- | engines/engine.cpp | 11 | ||||
-rw-r--r-- | engines/engine.h | 5 | ||||
-rw-r--r-- | engines/gob/detection.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/detection.cpp | 1 | ||||
-rw-r--r-- | engines/lure/detection.cpp | 1 | ||||
-rw-r--r-- | engines/metaengine.h | 9 | ||||
-rw-r--r-- | engines/parallaction/detection.cpp | 1 | ||||
-rw-r--r-- | engines/queen/queen.cpp | 1 | ||||
-rw-r--r-- | engines/saga/detection.cpp | 1 | ||||
-rw-r--r-- | engines/scumm/detection.cpp | 1 | ||||
-rw-r--r-- | engines/sky/sky.cpp | 1 | ||||
-rw-r--r-- | engines/sword1/sword1.cpp | 1 | ||||
-rw-r--r-- | engines/sword2/sword2.cpp | 1 | ||||
-rw-r--r-- | engines/touche/detection.cpp | 1 |
18 files changed, 48 insertions, 8 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 5427879f20..6b65526226 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -2131,6 +2131,7 @@ public: bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp index ce7be3d440..12f281d0dc 100644 --- a/engines/agos/detection.cpp +++ b/engines/agos/detection.cpp @@ -117,6 +117,7 @@ public: bool AgosMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves); } diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index c8a369a28f..c4b9a7808a 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -36,6 +36,7 @@ #include "engines/dialogs.h" #include "engines/engine.h" +#include "engines/metaengine.h" #ifdef SMALL_SCREEN_DEVICE #include "gui/KeysDialog.h" @@ -76,15 +77,18 @@ MainMenuDialog::MainMenuDialog(Engine *engine) new GUI::ButtonWidget(this, "globalmain_resume", "Resume", kPlayCmd, 'P'); -// new GUI::ButtonWidget(this, "scummmain_load", "Load", kLoadCmd, 'L'); -// new GUI::ButtonWidget(this, "scummmain_save", "Save", kSaveCmd, 'S'); +// new GUI::ButtonWidget(this, "globalmain_load", "Load", kLoadCmd, 'L'); +// new GUI::ButtonWidget(this, "globalmain_save", "Save", kSaveCmd, 'S'); new GUI::ButtonWidget(this, "globalmain_options", "Options", kOptionsCmd, 'O'); new GUI::ButtonWidget(this, "globalmain_about", "About", kAboutCmd, 'A'); - new GUI::ButtonWidget(this, "globalmain_rtl", "Return to Launcher", kRTLCmd, 'R'); - + _rtlButton = new GUI::ButtonWidget(this, "globalmain_rtl", "Return to Launcher", kRTLCmd, 'R'); + // '0' corresponds to the kSupportsRTL MetaEngineFeature + _rtlButton->setEnabled(_engine->hasFeature(0)); + + new GUI::ButtonWidget(this, "globalmain_quit", "Quit", kQuitCmd, 'Q'); _aboutDialog = new GUI::AboutDialog(); diff --git a/engines/dialogs.h b/engines/dialogs.h index dc6bff4dd6..61c06006cb 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -52,6 +52,7 @@ public: protected: Engine *_engine; + GUI::ButtonWidget *_rtlButton; GUI::Dialog *_aboutDialog; GUI::Dialog *_optionsDialog; diff --git a/engines/engine.cpp b/engines/engine.cpp index e3f53670b5..4840b19838 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -39,6 +39,7 @@ #include "gui/newgui.h" #include "sound/mixer.h" #include "engines/dialogs.h" +#include "engines/metaengine.h" #ifdef _WIN32_WCE extern bool isSmartphone(void); @@ -251,3 +252,13 @@ void Engine::quitGame() { event.type = Common::EVENT_QUIT; _eventMan->pushEvent(event); } + +bool Engine::hasFeature(int f) { + const EnginePlugin *plugin = 0; + Common::String gameid = ConfMan.get("gameid"); + gameid.toLowercase(); + EngineMan.findGame(gameid, &plugin); + + return ( (*plugin)->hasFeature((MetaEngine::MetaEngineFeature)f) ); +} + diff --git a/engines/engine.h b/engines/engine.h index 35b85cb7b7..d2f0849b51 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -30,6 +30,7 @@ #include "common/str.h" class OSystem; + namespace Audio { class Mixer; } @@ -138,6 +139,10 @@ public: */ virtual void syncSoundSettings(); + /** Determine whether the engine supports the specified MetaEngine feature + */ + virtual bool hasFeature(int f); + public: /** Setup the backend's graphics mode. */ diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 63a0f8f45b..15e343c8cc 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -1972,9 +1972,15 @@ public: return "Goblins Games (C) Coktel Vision"; } + virtual bool hasFeature(MetaEngineFeature f) const; virtual bool createInstance(OSystem *syst, Engine **engine, const Common::ADGameDescription *desc) const; }; +bool GobMetaEngine::hasFeature(MetaEngineFeature 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/kyra/detection.cpp b/engines/kyra/detection.cpp index 5ed556cc27..78b0863ac5 100644 --- a/engines/kyra/detection.cpp +++ b/engines/kyra/detection.cpp @@ -938,6 +938,7 @@ public: bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/lure/detection.cpp b/engines/lure/detection.cpp index dc23e4ad89..ccfa26fadc 100644 --- a/engines/lure/detection.cpp +++ b/engines/lure/detection.cpp @@ -192,6 +192,7 @@ public: bool LureMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/metaengine.h b/engines/metaengine.h index 15024ff661..c911e1c2ae 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -118,13 +118,14 @@ public: * in the launcher. */ enum MetaEngineFeature { - kSupportsListSaves, - kSupportsDirectLoad, - kSupportsDeleteSave + kSupportsRTL = 0, + kSupportsListSaves = 1, + kSupportsDirectLoad = 2, + kSupportsDeleteSave = 3 }; /** - * Determine whether the engine supports the specified feature + * Determine whether the engine supports the specified MetaEngine feature */ virtual bool hasFeature(MetaEngineFeature f) const { return false; }; diff --git a/engines/parallaction/detection.cpp b/engines/parallaction/detection.cpp index a65fc05b95..472fe1fd75 100644 --- a/engines/parallaction/detection.cpp +++ b/engines/parallaction/detection.cpp @@ -250,6 +250,7 @@ public: bool ParallactionMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 801a1c630a..d5c8203d6c 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -79,6 +79,7 @@ const char *QueenMetaEngine::getCopyright() const { bool QueenMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/saga/detection.cpp b/engines/saga/detection.cpp index 16ac3d7fb4..cc9ba34cdc 100644 --- a/engines/saga/detection.cpp +++ b/engines/saga/detection.cpp @@ -154,6 +154,7 @@ public: bool SagaMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp index 8d93b04a14..0622e3c5fe 100644 --- a/engines/scumm/detection.cpp +++ b/engines/scumm/detection.cpp @@ -686,6 +686,7 @@ public: bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 88f7f93d75..eecc7a9fbf 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -130,6 +130,7 @@ const char *SkyMetaEngine::getCopyright() const { bool SkyMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad); } diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index c20f1c1422..e6dc385d8b 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -106,6 +106,7 @@ public: bool SwordMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad); } diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 110d881c1d..4f942c0d25 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -91,6 +91,7 @@ public: bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index c4c428ba8d..89655ac9ab 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -143,6 +143,7 @@ public: bool ToucheMetaEngine::hasFeature(MetaEngineFeature f) const { return + (f == kSupportsRTL) || (f == kSupportsListSaves) || (f == kSupportsDirectLoad) || (f == kSupportsDeleteSave); |