[Scummvm-git-logs] scummvm master -> f25b3d93c1596eadc49578b8b331609168678429

dreammaster paulfgilbert at gmail.com
Mon Dec 31 02:47:41 CET 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f25b3d93c1 GLK: FROTZ: Split Infocom game list from other games list


Commit: f25b3d93c1596eadc49578b8b331609168678429
    https://github.com/scummvm/scummvm/commit/f25b3d93c1596eadc49578b8b331609168678429
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-30T16:23:38-08:00

Commit Message:
GLK: FROTZ: Split Infocom game list from other games list

Changed paths:
    engines/glk/frotz/detection.cpp
    engines/glk/frotz/detection_tables.h


diff --git a/engines/glk/frotz/detection.cpp b/engines/glk/frotz/detection.cpp
index fbe7126..97d7084 100644
--- a/engines/glk/frotz/detection.cpp
+++ b/engines/glk/frotz/detection.cpp
@@ -33,12 +33,18 @@ namespace Glk {
 namespace Frotz {
 
 void FrotzMetaEngine::getSupportedGames(PlainGameList &games) {
-	for (const PlainGameDescriptor *pd = FROTZ_GAME_LIST; pd->gameId; ++pd)
+	for (const PlainGameDescriptor *pd = INFOCOM_GAME_LIST; pd->gameId; ++pd)
+		games.push_back(*pd);
+	for (const PlainGameDescriptor *pd = ZCODE_GAME_LIST; pd->gameId; ++pd)
 		games.push_back(*pd);
 }
 
 PlainGameDescriptor FrotzMetaEngine::findGame(const char *gameId) {
-	for (const PlainGameDescriptor *pd = FROTZ_GAME_LIST; pd->gameId; ++pd) {
+	for (const PlainGameDescriptor *pd = INFOCOM_GAME_LIST; pd->gameId; ++pd) {
+		if (!strcmp(gameId, pd->gameId))
+			return *pd;
+	}
+	for (const PlainGameDescriptor *pd = ZCODE_GAME_LIST; pd->gameId; ++pd) {
 		if (!strcmp(gameId, pd->gameId))
 			return *pd;
 	}
@@ -120,7 +126,7 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
 				debug("ENTRY0(\"%s\", %s, \"%s\", %u),",
 					fname.c_str(), strlen(serial) ? serial : "nullptr", md5.c_str(), (uint)filesize);
 			}
-			const PlainGameDescriptor &desc = FROTZ_GAME_LIST[0];
+			const PlainGameDescriptor &desc = ZCODE_GAME_LIST[0];
 			gd = DetectedGame(desc.gameId, desc.description, Common::UNK_LANG, Common::kPlatformUnknown);
 		} else {
 			PlainGameDescriptor gameDesc = findGame(p->_gameId);
@@ -136,10 +142,12 @@ bool FrotzMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
 }
 
 void FrotzMetaEngine::detectClashes(Common::StringMap &map) {
-	for (const PlainGameDescriptor *pd = FROTZ_GAME_LIST; pd->gameId; ++pd) {
-		if (map.contains(pd->gameId))
-			error("Duplicate game Id found - %s", pd->gameId);
-		map[pd->gameId] = "";
+	for (int idx = 0; idx < 2; ++idx) {
+		for (const PlainGameDescriptor *pd = (idx == 0) ? INFOCOM_GAME_LIST : ZCODE_GAME_LIST; pd->gameId; ++pd) {
+			if (map.contains(pd->gameId))
+				error("Duplicate game Id found - %s", pd->gameId);
+			map[pd->gameId] = "";
+		}
 	}
 }
 
diff --git a/engines/glk/frotz/detection_tables.h b/engines/glk/frotz/detection_tables.h
index 77e6739..e676f7d 100644
--- a/engines/glk/frotz/detection_tables.h
+++ b/engines/glk/frotz/detection_tables.h
@@ -39,9 +39,10 @@ struct FrotzGameDescription {
 	const char *const _guiOptions;
 };
 
-const PlainGameDescriptor FROTZ_GAME_LIST[] = {
-	{ "zcode", "Unknown Z-code game" },
-
+/**
+ * Original games from Infocom
+ */
+const PlainGameDescriptor INFOCOM_GAME_LIST[] = {
 	// Infocom games
 	{ "amfv", "A Mind Forever Voyaging" },
 	{ "arthur", "Arthur: The Quest for Excalibur" },
@@ -82,6 +83,14 @@ const PlainGameDescriptor FROTZ_GAME_LIST[] = {
 	{ "zork2", "Zork II: The Wizard of Frobozz" },
 	{ "zork3", "Zork III: The Dungeon Master" },
 	{ "ztuu", "Zork: The Undiscovered Underground" },
+	{ nullptr, nullptr }
+};
+
+/**
+ * All the other subsequent non-Infocom games using the format
+ */
+const PlainGameDescriptor ZCODE_GAME_LIST[] = {
+	{ "zcode", "Unknown Z-code game" },
 
 	// English games
 	{ "404life",           "404 - Life not found" },





More information about the Scummvm-git-logs mailing list