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

sev at users.sourceforge.net sev at users.sourceforge.net
Sat Jun 6 19:57:39 CEST 2009


Revision: 41274
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41274&view=rev
Author:   sev
Date:     2009-06-06 17:57:39 +0000 (Sat, 06 Jun 2009)

Log Message:
-----------
Add GUI options support to Sky, Queen and Sword1&2 engines (which do not use AD)

Modified Paths:
--------------
    scummvm/trunk/engines/game.cpp
    scummvm/trunk/engines/game.h
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/sky/detection.cpp
    scummvm/trunk/engines/sword1/detection.cpp
    scummvm/trunk/engines/sword2/sword2.cpp

Modified: scummvm/trunk/engines/game.cpp
===================================================================
--- scummvm/trunk/engines/game.cpp	2009-06-06 17:56:59 UTC (rev 41273)
+++ scummvm/trunk/engines/game.cpp	2009-06-06 17:57:39 UTC (rev 41274)
@@ -48,15 +48,32 @@
 	setVal("description", pgd.description);
 }
 
-GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p) {
+GameDescriptor::GameDescriptor(const PlainGameDescriptorGUIOpts &pgd) {
+	setVal("gameid", pgd.gameid);
+	setVal("description", pgd.description);
+
+	if (pgd.guioptions != 0)
+		setVal("guioptions", Common::getGameGUIOptionsDescription(pgd.guioptions));
+}
+
+GameDescriptor::GameDescriptor(const Common::String &g, const Common::String &d, Common::Language l, Common::Platform p, uint32 guioptions) {
 	setVal("gameid", g);
 	setVal("description", d);
 	if (l != Common::UNK_LANG)
 		setVal("language", Common::getLanguageCode(l));
 	if (p != Common::kPlatformUnknown)
 		setVal("platform", Common::getPlatformCode(p));
+	if (guioptions != 0)
+		setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions));
 }
 
+void GameDescriptor::setGUIOptions(uint32 guioptions) {
+	if (guioptions != 0)
+		setVal("guioptions", Common::getGameGUIOptionsDescription(guioptions));
+	else
+		erase("guioptions");
+}
+
 void GameDescriptor::updateDesc(const char *extra) {
 	// TODO: The format used here (LANG/PLATFORM/EXTRA) is not set in stone.
 	// We may want to change the order (PLATFORM/EXTRA/LANG, anybody?), or

Modified: scummvm/trunk/engines/game.h
===================================================================
--- scummvm/trunk/engines/game.h	2009-06-06 17:56:59 UTC (rev 41273)
+++ scummvm/trunk/engines/game.h	2009-06-06 17:57:39 UTC (rev 41274)
@@ -47,6 +47,17 @@
 };
 
 /**
+ * Same as PlainGameDsscriptor except it adds Game GUI options parameter
+ * This is a plain struct to make it possible to declare NULL-terminated C arrays
+ * consisting of PlainGameDescriptors.
+ */
+struct PlainGameDescriptorGUIOpts {
+	const char *gameid;
+	const char *description;
+	uint32 guioptions;
+};
+
+/**
  * Given a list of PlainGameDescriptors, returns the first PlainGameDescriptor
  * matching the given gameid. If not match is found return 0.
  * The end of the list must marked by a PlainGameDescriptor with gameid equal to 0.
@@ -64,16 +75,20 @@
 public:
 	GameDescriptor();
 	GameDescriptor(const PlainGameDescriptor &pgd);
+	GameDescriptor(const PlainGameDescriptorGUIOpts &pgd);
 	GameDescriptor(const Common::String &gameid,
 	              const Common::String &description,
 	              Common::Language language = Common::UNK_LANG,
-	              Common::Platform platform = Common::kPlatformUnknown);
+				  Common::Platform platform = Common::kPlatformUnknown,
+				  uint32 guioptions = 0);
 
 	/**
 	 * Update the description string by appending (LANG/PLATFORM/EXTRA) to it.
 	 */
 	void updateDesc(const char *extra = 0);
 
+	void setGUIOptions(uint32 options);
+
 	Common::String &gameid() { return getVal("gameid"); }
 	Common::String &description() { return getVal("description"); }
 	const Common::String &gameid() const { return getVal("gameid"); }

Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp	2009-06-06 17:56:59 UTC (rev 41273)
+++ scummvm/trunk/engines/queen/queen.cpp	2009-06-06 17:57:39 UTC (rev 41274)
@@ -120,10 +120,13 @@
 				GameDescriptor dg(queenGameDescriptor.gameid, queenGameDescriptor.description, version.language, version.platform);
 				if (version.features & Queen::GF_DEMO) {
 					dg.updateDesc("Demo");
+					dg.setGUIOptions(Common::GUIO_NOSPEECH);
 				} else if (version.features & Queen::GF_INTERVIEW) {
 					dg.updateDesc("Interview");
+					dg.setGUIOptions(Common::GUIO_NOSPEECH);
 				} else if (version.features & Queen::GF_FLOPPY) {
 					dg.updateDesc("Floppy");
+					dg.setGUIOptions(Common::GUIO_NOSPEECH);
 				} else if (version.features & Queen::GF_TALKIE) {
 					dg.updateDesc("Talkie");
 				}

Modified: scummvm/trunk/engines/sky/detection.cpp
===================================================================
--- scummvm/trunk/engines/sky/detection.cpp	2009-06-06 17:56:59 UTC (rev 41273)
+++ scummvm/trunk/engines/sky/detection.cpp	2009-06-06 17:57:39 UTC (rev 41274)
@@ -45,21 +45,22 @@
 	int dataDiskSize;
 	const char *extraDesc;
 	int version;
+	uint32 guioptions;
 };
 
 // TODO: Would be nice if Disk::determineGameVersion() used this table, too.
 static const SkyVersion skyVersions[] = {
-	{  232, -1, "floppy demo", 272 }, // German
-	{  243, -1, "pc gamer demo", 109 },
-	{  247, -1, "floppy demo", 267 }, // English
-	{ 1404, -1, "floppy", 288 },
-	{ 1413, -1, "floppy", 303 },
-	{ 1445, 8830435, "floppy", 348 },
-	{ 1445, -1, "floppy", 331 },
-	{ 1711, -1, "cd demo", 365 },
-	{ 5099, -1, "cd", 368 },
-	{ 5097, -1, "cd", 372 },
-	{ 0, 0, 0, 0 }
+	{  232, -1, "floppy demo", 272, Common::GUIO_NOSPEECH }, // German
+	{  243, -1, "pc gamer demo", 109, Common::GUIO_NOSPEECH },
+	{  247, -1, "floppy demo", 267, Common::GUIO_NOSPEECH }, // English
+	{ 1404, -1, "floppy", 288, Common::GUIO_NOSPEECH },
+	{ 1413, -1, "floppy", 303, Common::GUIO_NOSPEECH },
+	{ 1445, 8830435, "floppy", 348, Common::GUIO_NOSPEECH },
+	{ 1445, -1, "floppy", 331, Common::GUIO_NOSPEECH },
+	{ 1711, -1, "cd demo", 365, Common::GUIO_NONE },
+	{ 5099, -1, "cd", 368, Common::GUIO_NONE },
+	{ 5097, -1, "cd", 372, Common::GUIO_NONE },
+	{ 0, 0, 0, 0, 0 }
 };
 
 class SkyMetaEngine : public MetaEngine {
@@ -155,6 +156,7 @@
 				char buf[32];
 				snprintf(buf, sizeof(buf), "v0.0%d %s", sv->version, sv->extraDesc);
 				dg.updateDesc(buf);
+				dg.setGUIOptions(sv->guioptions);
 				break;
 			}
 			++sv;

Modified: scummvm/trunk/engines/sword1/detection.cpp
===================================================================
--- scummvm/trunk/engines/sword1/detection.cpp	2009-06-06 17:56:59 UTC (rev 41273)
+++ scummvm/trunk/engines/sword1/detection.cpp	2009-06-06 17:57:39 UTC (rev 41274)
@@ -37,16 +37,16 @@
 #include "engines/metaengine.h"
 
 /* Broken Sword 1 */
-static const PlainGameDescriptor sword1FullSettings =
-	{"sword1", "Broken Sword 1: The Shadow of the Templars"};
-static const PlainGameDescriptor sword1DemoSettings =
-	{"sword1demo", "Broken Sword 1: The Shadow of the Templars (Demo)"};
-static const PlainGameDescriptor sword1MacFullSettings =
-	{"sword1mac", "Broken Sword 1: The Shadow of the Templars (Mac)"};
-static const PlainGameDescriptor sword1MacDemoSettings =
-	{"sword1macdemo", "Broken Sword 1: The Shadow of the Templars (Mac demo)"};
-static const PlainGameDescriptor sword1PSXSettings =
-	{"sword1psx", "Broken Sword 1: The Shadow of the Templars (PlayStation)"};
+static const PlainGameDescriptorGUIOpts sword1FullSettings =
+	{"sword1", "Broken Sword 1: The Shadow of the Templars", Common::GUIO_NOMIDI};
+static const PlainGameDescriptorGUIOpts sword1DemoSettings =
+	{"sword1demo", "Broken Sword 1: The Shadow of the Templars (Demo)", Common::GUIO_NOMIDI};
+static const PlainGameDescriptorGUIOpts sword1MacFullSettings =
+	{"sword1mac", "Broken Sword 1: The Shadow of the Templars (Mac)", Common::GUIO_NOMIDI};
+static const PlainGameDescriptorGUIOpts sword1MacDemoSettings =
+	{"sword1macdemo", "Broken Sword 1: The Shadow of the Templars (Mac demo)", Common::GUIO_NOMIDI};
+static const PlainGameDescriptorGUIOpts sword1PSXSettings =
+	{"sword1psx", "Broken Sword 1: The Shadow of the Templars (PlayStation)", Common::GUIO_NOMIDI};
 
 // check these subdirectories (if present)
 static const char *g_dirNames[] = {	"clusters",	"speech" };

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2009-06-06 17:56:59 UTC (rev 41273)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2009-06-06 17:57:39 UTC (rev 41274)
@@ -148,7 +148,7 @@
 
 				if (0 == scumm_stricmp(g->detectname, fileName)) {
 					// Match found, add to list of candidates, then abort inner loop.
-					detectedGames.push_back(GameDescriptor(g->gameid, g->description));
+					detectedGames.push_back(GameDescriptor(g->gameid, g->description, Common::UNK_LANG, Common::kPlatformUnknown, Common::GUIO_NOMIDI));
 					break;
 				}
 			}


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