[Scummvm-cvs-logs] SF.net SVN: scummvm:[33921] scummvm/branches/gsoc2008-rtl/engines

cpage88 at users.sourceforge.net cpage88 at users.sourceforge.net
Sat Aug 16 04:53:18 CEST 2008


Revision: 33921
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33921&view=rev
Author:   cpage88
Date:     2008-08-16 02:53:16 +0000 (Sat, 16 Aug 2008)

Log Message:
-----------
Added a MetaEngineFeature for RTL support, the RTL button is disabled in the GMM if the engine doesn't support it

Modified Paths:
--------------
    scummvm/branches/gsoc2008-rtl/engines/agi/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/agos/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp
    scummvm/branches/gsoc2008-rtl/engines/dialogs.h
    scummvm/branches/gsoc2008-rtl/engines/engine.cpp
    scummvm/branches/gsoc2008-rtl/engines/engine.h
    scummvm/branches/gsoc2008-rtl/engines/gob/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/kyra/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/lure/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/metaengine.h
    scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/queen/queen.cpp
    scummvm/branches/gsoc2008-rtl/engines/saga/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp
    scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
    scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp
    scummvm/branches/gsoc2008-rtl/engines/sword2/sword2.cpp
    scummvm/branches/gsoc2008-rtl/engines/touche/detection.cpp

Modified: scummvm/branches/gsoc2008-rtl/engines/agi/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agi/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/agi/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -2131,6 +2131,7 @@
 
 bool AgiMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/agos/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agos/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/agos/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -117,6 +117,7 @@
 
 bool AgosMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves);
 }
 

Modified: scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/dialogs.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -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 @@
 
 	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();

Modified: scummvm/branches/gsoc2008-rtl/engines/dialogs.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/dialogs.h	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/dialogs.h	2008-08-16 02:53:16 UTC (rev 33921)
@@ -52,6 +52,7 @@
 protected:
 	Engine			*_engine;
 
+	GUI::ButtonWidget	*_rtlButton;
 	GUI::Dialog		*_aboutDialog;
 	GUI::Dialog		*_optionsDialog;
 

Modified: scummvm/branches/gsoc2008-rtl/engines/engine.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/engine.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/engine.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -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 @@
 	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) );
+}
+

Modified: scummvm/branches/gsoc2008-rtl/engines/engine.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/engine.h	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/engine.h	2008-08-16 02:53:16 UTC (rev 33921)
@@ -30,6 +30,7 @@
 #include "common/str.h"
 
 class OSystem;
+
 namespace Audio {
 	class Mixer;
 }
@@ -138,6 +139,10 @@
 	 */
 	virtual void syncSoundSettings();
 
+	/** Determine whether the engine supports the specified MetaEngine feature
+	 */
+	virtual bool hasFeature(int f);
+
 public:
 
 	/** Setup the backend's graphics mode. */

Modified: scummvm/branches/gsoc2008-rtl/engines/gob/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/gob/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/gob/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -1972,9 +1972,15 @@
 		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) {

Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -938,6 +938,7 @@
 
 bool KyraMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/lure/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -192,6 +192,7 @@
 
 bool LureMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/metaengine.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/metaengine.h	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/metaengine.h	2008-08-16 02:53:16 UTC (rev 33921)
@@ -118,13 +118,14 @@
 	 *  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; };
 

Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -250,6 +250,7 @@
 
 bool ParallactionMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/queen/queen.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/queen/queen.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/queen/queen.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -79,6 +79,7 @@
 
 bool QueenMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/saga/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/saga/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/saga/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -154,6 +154,7 @@
 
 bool SagaMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/scumm/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -686,6 +686,7 @@
 
 bool ScummMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/sky.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -130,6 +130,7 @@
 
 bool SkyMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad);
 }

Modified: scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/sword1/sword1.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -106,6 +106,7 @@
 
 bool SwordMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad);
 }

Modified: scummvm/branches/gsoc2008-rtl/engines/sword2/sword2.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sword2/sword2.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/sword2/sword2.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -91,6 +91,7 @@
 
 bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);

Modified: scummvm/branches/gsoc2008-rtl/engines/touche/detection.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/detection.cpp	2008-08-16 00:08:12 UTC (rev 33920)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/detection.cpp	2008-08-16 02:53:16 UTC (rev 33921)
@@ -143,6 +143,7 @@
 
 bool ToucheMetaEngine::hasFeature(MetaEngineFeature f) const {
 	return
+		(f == kSupportsRTL) ||
 		(f == kSupportsListSaves) ||
 		(f == kSupportsDirectLoad) ||
 		(f == kSupportsDeleteSave);


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