aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-10-03 16:07:57 +0000
committerMax Horn2008-10-03 16:07:57 +0000
commit84229ee79c484e199f9a5e74d5ffae6b29747f2a (patch)
treecf9c9f1664f8438de8eeb10141c572c946e6eb9d
parentb178332e3e5eef2972e566b5a4fca5b66189ba20 (diff)
downloadscummvm-rg350-84229ee79c484e199f9a5e74d5ffae6b29747f2a.tar.gz
scummvm-rg350-84229ee79c484e199f9a5e74d5ffae6b29747f2a.tar.bz2
scummvm-rg350-84229ee79c484e199f9a5e74d5ffae6b29747f2a.zip
Fixed Engine::hasFeature to use proper types (i.e., MetaEngine::MetaEngineFeature instead of int)
svn-id: r34731
-rw-r--r--engines/dialogs.cpp3
-rw-r--r--engines/engine.cpp6
-rw-r--r--engines/engine.h4
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp
index 7c5963544c..9f073cd545 100644
--- a/engines/dialogs.cpp
+++ b/engines/dialogs.cpp
@@ -103,8 +103,7 @@ MainMenuDialog::MainMenuDialog(Engine *engine)
new GUI::ButtonWidget(this, "globalmain_about", "About", kAboutCmd, 'A');
_rtlButton = new GUI::ButtonWidget(this, "globalmain_rtl", "Return to Launcher", kRTLCmd, 'R');
- // '0' corresponds to the kSupportsRTL MetaEngineFeature
- _rtlButton->setEnabled(_engine->hasFeature(0));
+ _rtlButton->setEnabled(_engine->hasFeature(MetaEngine::kSupportsRTL));
new GUI::ButtonWidget(this, "globalmain_quit", "Quit", kQuitCmd, 'Q');
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 57efad5c19..c99187d2f2 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -250,13 +250,13 @@ void Engine::quitGame() {
_eventMan->pushEvent(event);
}
-bool Engine::hasFeature(int f) {
+bool Engine::hasFeature(MetaEngine::MetaEngineFeature f) {
// TODO: In each engine, keep a ref to the corresponding MetaEngine?
const EnginePlugin *plugin = 0;
Common::String gameid = ConfMan.get("gameid");
gameid.toLowercase();
EngineMan.findGame(gameid, &plugin);
-
- return ( (*plugin)->hasFeature((MetaEngine::MetaEngineFeature)f) );
+ assert(plugin);
+ return ( (*plugin)->hasFeature(f) );
}
diff --git a/engines/engine.h b/engines/engine.h
index dec85885d8..148e4f24c6 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -30,6 +30,8 @@
#include "common/fs.h"
#include "common/str.h"
+#include "engines/metaengine.h"
+
class OSystem;
namespace Audio {
@@ -177,7 +179,7 @@ public:
/**
* Determine whether the engine supports the specified MetaEngine feature.
*/
- bool hasFeature(int f);
+ bool hasFeature(MetaEngine::MetaEngineFeature f);
public: