aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2009-06-06 17:57:39 +0000
committerEugene Sandulenko2009-06-06 17:57:39 +0000
commiteb909702af7a1fc48c77b000cc4b4e647ebf4e60 (patch)
tree30fec2c9212ffc4bc07901c0de297476e925c05c
parent8eb417e15e978729b6724a9e9da38b9d6897e5de (diff)
downloadscummvm-rg350-eb909702af7a1fc48c77b000cc4b4e647ebf4e60.tar.gz
scummvm-rg350-eb909702af7a1fc48c77b000cc4b4e647ebf4e60.tar.bz2
scummvm-rg350-eb909702af7a1fc48c77b000cc4b4e647ebf4e60.zip
Add GUI options support to Sky, Queen and Sword1&2 engines (which do not use AD)
svn-id: r41274
-rw-r--r--engines/game.cpp19
-rw-r--r--engines/game.h17
-rw-r--r--engines/queen/queen.cpp3
-rw-r--r--engines/sky/detection.cpp24
-rw-r--r--engines/sword1/detection.cpp20
-rw-r--r--engines/sword2/sword2.cpp2
6 files changed, 61 insertions, 24 deletions
diff --git a/engines/game.cpp b/engines/game.cpp
index c8cfcc663b..0bd1c59791 100644
--- a/engines/game.cpp
+++ b/engines/game.cpp
@@ -48,13 +48,30 @@ GameDescriptor::GameDescriptor(const PlainGameDescriptor &pgd) {
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) {
diff --git a/engines/game.h b/engines/game.h
index 6c73941577..63c988a345 100644
--- a/engines/game.h
+++ b/engines/game.h
@@ -47,6 +47,17 @@ struct PlainGameDescriptor {
};
/**
+ * 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 @@ class GameDescriptor : public Common::StringMap {
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"); }
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index 3c984c20fa..ec074190d3 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -120,10 +120,13 @@ GameList QueenMetaEngine::detectGames(const Common::FSList &fslist) const {
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");
}
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index 55c61b8665..1a14703972 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -45,21 +45,22 @@ struct SkyVersion {
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 @@ GameList SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
char buf[32];
snprintf(buf, sizeof(buf), "v0.0%d %s", sv->version, sv->extraDesc);
dg.updateDesc(buf);
+ dg.setGUIOptions(sv->guioptions);
break;
}
++sv;
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index d78c6259f9..59d999bdc9 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -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" };
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index c840a50f0a..cf44b4c99c 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -148,7 +148,7 @@ GameList Sword2MetaEngine::detectGames(const Common::FSList &fslist) const {
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;
}
}