[Scummvm-cvs-logs] SF.net SVN: scummvm:[34731] scummvm/trunk/engines

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Oct 3 18:07:57 CEST 2008


Revision: 34731
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34731&view=rev
Author:   fingolfin
Date:     2008-10-03 16:07:57 +0000 (Fri, 03 Oct 2008)

Log Message:
-----------
Fixed Engine::hasFeature to use proper types (i.e., MetaEngine::MetaEngineFeature instead of int)

Modified Paths:
--------------
    scummvm/trunk/engines/dialogs.cpp
    scummvm/trunk/engines/engine.cpp
    scummvm/trunk/engines/engine.h

Modified: scummvm/trunk/engines/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/dialogs.cpp	2008-10-03 14:25:03 UTC (rev 34730)
+++ scummvm/trunk/engines/dialogs.cpp	2008-10-03 16:07:57 UTC (rev 34731)
@@ -103,8 +103,7 @@
 	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');

Modified: scummvm/trunk/engines/engine.cpp
===================================================================
--- scummvm/trunk/engines/engine.cpp	2008-10-03 14:25:03 UTC (rev 34730)
+++ scummvm/trunk/engines/engine.cpp	2008-10-03 16:07:57 UTC (rev 34731)
@@ -250,13 +250,13 @@
 	_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) );
 }
 

Modified: scummvm/trunk/engines/engine.h
===================================================================
--- scummvm/trunk/engines/engine.h	2008-10-03 14:25:03 UTC (rev 34730)
+++ scummvm/trunk/engines/engine.h	2008-10-03 16:07:57 UTC (rev 34731)
@@ -30,6 +30,8 @@
 #include "common/fs.h"
 #include "common/str.h"
 
+#include "engines/metaengine.h"
+
 class OSystem;
 
 namespace Audio {
@@ -177,7 +179,7 @@
 	/**
 	 * Determine whether the engine supports the specified MetaEngine feature.
 	 */
-	bool hasFeature(int f);
+	bool hasFeature(MetaEngine::MetaEngineFeature f);
 
 public:
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list