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

jvprat at users.sourceforge.net jvprat at users.sourceforge.net
Sun Feb 3 10:39:26 CET 2008


Revision: 30752
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30752&view=rev
Author:   jvprat
Date:     2008-02-03 01:39:26 -0800 (Sun, 03 Feb 2008)

Log Message:
-----------
Converted queen and sky to use MetaEngine (forgot them because they don't use the AdvancedDetector).

Modified Paths:
--------------
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/sky/sky.cpp

Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp	2008-02-03 09:35:04 UTC (rev 30751)
+++ scummvm/trunk/engines/queen/queen.cpp	2008-02-03 09:39:26 UTC (rev 30752)
@@ -49,24 +49,47 @@
 #include "queen/talk.h"
 #include "queen/walk.h"
 
+#include "engines/metaengine.h"
+
 static const PlainGameDescriptor queenGameDescriptor = {
 	"queen", "Flight of the Amazon Queen"
 };
 
-GameList Engine_QUEEN_gameIDList() {
+class QueenMetaEngine : public MetaEngine {
+public:
+	virtual const char *getName() const;
+	virtual const char *getCopyright() const;
+//	virtual int getVersion() const	{ return 0; }	// TODO!
+
+	virtual GameList getSupportedGames() const;
+	virtual GameDescriptor findGame(const char *gameid) const;
+	virtual GameList detectGames(const FSList &fslist) const;
+
+	virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
+};
+
+const char *QueenMetaEngine::getName() const {
+	return "Flight of the Amazon Queen";
+}
+
+const char *QueenMetaEngine::getCopyright() const {
+	return "Flight of the Amazon Queen (C) John Passfield and Steve Stamatiadis";
+}
+
+GameList QueenMetaEngine::getSupportedGames() const {
 	GameList games;
 	games.push_back(queenGameDescriptor);
 	return games;
 }
 
-GameDescriptor Engine_QUEEN_findGameID(const char *gameid) {
+GameDescriptor QueenMetaEngine::findGame(const char *gameid) const {
 	if (0 == scumm_stricmp(gameid, queenGameDescriptor.gameid)) {
 		return queenGameDescriptor;
 	}
 	return GameDescriptor();
 }
 
-GameList Engine_QUEEN_detectGames(const FSList &fslist) {
+GameList QueenMetaEngine::detectGames(const FSList &fslist) const {
 	GameList detectedGames;
 
 	// Iterate over all files in the given directory
@@ -99,12 +122,14 @@
 	return detectedGames;
 }
 
-PluginError Engine_QUEEN_create(OSystem *syst, Engine **engine) {
+PluginError QueenMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
 	assert(engine);
 	*engine = new Queen::QueenEngine(syst);
 	return kNoError;
 }
 
+META_COMPATIBLITY_WRAPPER(QUEEN, QueenMetaEngine);
+
 REGISTER_PLUGIN(QUEEN, "Flight of the Amazon Queen", "Flight of the Amazon Queen (C) John Passfield and Steve Stamatiadis");
 
 namespace Queen {

Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp	2008-02-03 09:35:04 UTC (rev 30751)
+++ scummvm/trunk/engines/sky/sky.cpp	2008-02-03 09:39:26 UTC (rev 30752)
@@ -55,6 +55,8 @@
 #include "sound/mididrv.h"
 #include "sound/mixer.h"
 
+#include "engines/metaengine.h"
+
 #ifdef _WIN32_WCE
 
 extern bool toolbar_drawn;
@@ -81,18 +83,6 @@
 static const PlainGameDescriptor skySetting =
 	{"sky", "Beneath a Steel Sky" };
 
-GameList Engine_SKY_gameIDList() {
-	GameList games;
-	games.push_back(skySetting);
-	return games;
-}
-
-GameDescriptor Engine_SKY_findGameID(const char *gameid) {
-	if (0 == scumm_stricmp(gameid, skySetting.gameid))
-		return skySetting;
-	return GameDescriptor();
-}
-
 struct SkyVersion {
 	int dinnerTableEntries;
 	int dataDiskSize;
@@ -114,7 +104,40 @@
 	{ 0, 0, 0, 0 }
 };
 
-GameList Engine_SKY_detectGames(const FSList &fslist) {
+class SkyMetaEngine : public MetaEngine {
+public:
+	virtual const char *getName() const;
+	virtual const char *getCopyright() const;
+//	virtual int getVersion() const	{ return 0; }	// TODO!
+
+	virtual GameList getSupportedGames() const;
+	virtual GameDescriptor findGame(const char *gameid) const;
+	virtual GameList detectGames(const FSList &fslist) const;
+
+	virtual PluginError createInstance(OSystem *syst, Engine **engine) const;
+};
+
+const char *SkyMetaEngine::getName() const {
+	return "Beneath a Steel Sky";
+}
+
+const char *SkyMetaEngine::getCopyright() const {
+	return "Beneath a Steel Sky (C) Revolution";
+}
+
+GameList SkyMetaEngine::getSupportedGames() const {
+	GameList games;
+	games.push_back(skySetting);
+	return games;
+}
+
+GameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
+	if (0 == scumm_stricmp(gameid, skySetting.gameid))
+		return skySetting;
+	return GameDescriptor();
+}
+
+GameList SkyMetaEngine::detectGames(const FSList &fslist) const {
 	GameList detectedGames;
 	bool hasSkyDsk = false;
 	bool hasSkyDnr = false;
@@ -166,12 +189,14 @@
 	return detectedGames;
 }
 
-PluginError Engine_SKY_create(OSystem *syst, Engine **engine) {
+PluginError SkyMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
 	assert(engine);
 	*engine = new Sky::SkyEngine(syst);
 	return kNoError;
 }
 
+META_COMPATIBLITY_WRAPPER(SKY, SkyMetaEngine);
+
 REGISTER_PLUGIN(SKY, "Beneath a Steel Sky", "Beneath a Steel Sky (C) Revolution");
 
 


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