| CODENOTIFIER | HelpYou are not signed inSign in |
Project: ScummVM
Revision: 34731
Author: fingolfin
Date: 03 Oct 2008 12:07:57
Changes:Fixed Engine::hasFeature to use proper types (i.e., MetaEngine::MetaEngineFeature instead of int)
Files:| ... | ...@@ -103,8 +103,7 @@ | |
| 103 | 103 | new GUI::ButtonWidget(this, "globalmain_about", "About", kAboutCmd, 'A'); |
| 104 | 104 | |
| 105 | 105 | _rtlButton = new GUI::ButtonWidget(this, "globalmain_rtl", "Return to Launcher", kRTLCmd, 'R'); |
| 106 | // '0' corresponds to the kSupportsRTL MetaEngineFeature | |
| 107 | _rtlButton->setEnabled(_engine->hasFeature(0)); | |
| 106 | _rtlButton->setEnabled(_engine->hasFeature(MetaEngine::kSupportsRTL)); | |
| 108 | 107 | |
| 109 | 108 | |
| 110 | 109 | new GUI::ButtonWidget(this, "globalmain_quit", "Quit", kQuitCmd, 'Q'); |
| ... | ...@@ -250,13 +250,13 @@ | |
| 250 | 250 | _eventMan->pushEvent(event); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | bool Engine::hasFeature(int f) { | |
| 253 | bool Engine::hasFeature(MetaEngine::MetaEngineFeature f) { | |
| 254 | 254 | // TODO: In each engine, keep a ref to the corresponding MetaEngine? |
| 255 | 255 | const EnginePlugin *plugin = 0; |
| 256 | 256 | Common::String gameid = ConfMan.get("gameid"); |
| 257 | 257 | gameid.toLowercase(); |
| 258 | 258 | EngineMan.findGame(gameid, &plugin); |
| 259 | ||
| 260 | return ( (*plugin)->hasFeature((MetaEngine::MetaEngineFeature)f) ); | |
| 259 | assert(plugin); | |
| 260 | return ( (*plugin)->hasFeature(f) ); | |
| 261 | 261 | } |
| 262 | 262 |
| ... | ...@@ -30,6 +30,8 @@ | |
| 30 | 30 | #include "common/fs.h" |
| 31 | 31 | #include "common/str.h" |
| 32 | 32 | |
| 33 | #include "engines/metaengine.h" | |
| 34 | ||
| 33 | 35 | class OSystem; |
| 34 | 36 | |
| 35 | 37 | namespace Audio { |
| ... | ...@@ -177,7 +179,7 @@ | |
| 177 | 179 | /** |
| 178 | 180 | * Determine whether the engine supports the specified MetaEngine feature. |
| 179 | 181 | */ |
| 180 | bool hasFeature(int f); | |
| 182 | bool hasFeature(MetaEngine::MetaEngineFeature f); | |
| 181 | 183 | |
| 182 | 184 | public: |
| 183 | 185 |