[Scummvm-git-logs] scummvm master -> ea53893300a02a37a2775bb1ffd4c585b7c27157
dreammaster
paulfgilbert at gmail.com
Tue Jan 1 08:58:37 CET 2019
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:
ea53893300 GLK: TADS: Split game list arrays into v2 and v3
Commit: ea53893300a02a37a2775bb1ffd4c585b7c27157
https://github.com/scummvm/scummvm/commit/ea53893300a02a37a2775bb1ffd4c585b7c27157
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-31T23:58:11-08:00
Commit Message:
GLK: TADS: Split game list arrays into v2 and v3
Changed paths:
engines/glk/tads/detection.cpp
engines/glk/tads/detection_tables.h
diff --git a/engines/glk/tads/detection.cpp b/engines/glk/tads/detection.cpp
index 9206193..9e1eb08 100644
--- a/engines/glk/tads/detection.cpp
+++ b/engines/glk/tads/detection.cpp
@@ -31,15 +31,27 @@ namespace Glk {
namespace TADS {
void TADSMetaEngine::getSupportedGames(PlainGameList &games) {
- for (const GameDescriptor *pd = TADS_GAME_LIST; pd->_gameId; ++pd) {
+ for (const PlainGameDescriptor *pd = TADS2_GAME_LIST; pd->gameId; ++pd)
+ games.push_back(*pd);
+ for (const PlainGameDescriptor *pd = TADS3_GAME_LIST; pd->gameId; ++pd)
games.push_back(*pd);
- }
}
GameDescriptor TADSMetaEngine::findGame(const char *gameId) {
- for (const GameDescriptor *pd = TADS_GAME_LIST; pd->_gameId; ++pd) {
- if (!strcmp(gameId, pd->_gameId))
- return *pd;
+ for (const PlainGameDescriptor *pd = TADS2_GAME_LIST; pd->gameId; ++pd) {
+ if (!strcmp(gameId, pd->gameId)) {
+ GameDescriptor gd = *pd;
+ gd._options = OPTION_TADS2;
+ return gd;
+ }
+ }
+
+ for (const PlainGameDescriptor *pd = TADS3_GAME_LIST; pd->gameId; ++pd) {
+ if (!strcmp(gameId, pd->gameId)) {
+ GameDescriptor gd = *pd;
+ gd._options = OPTION_TADS3;
+ return gd;
+ }
}
return GameDescriptor::empty();
@@ -81,10 +93,9 @@ bool TADSMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
debug("ENTRY0(\"%s\", \"%s\", %u),", fname.c_str(), md5.c_str(), (uint)filesize);
}
- const GameDescriptor &desc = TADS_GAME_LIST[0];
+ const GameDescriptor &desc = TADS2_GAME_LIST[0];
gd = DetectedGame(desc._gameId, desc._description, Common::UNK_LANG, Common::kPlatformUnknown);
- }
- else {
+ } else {
PlainGameDescriptor gameDesc = findGame(p->_gameId);
gd = DetectedGame(p->_gameId, gameDesc.description, p->_language, Common::kPlatformUnknown, p->_extra);
}
@@ -97,10 +108,15 @@ bool TADSMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &ga
}
void TADSMetaEngine::detectClashes(Common::StringMap &map) {
- for (const GameDescriptor *pd = TADS_GAME_LIST; pd->_gameId; ++pd) {
- if (map.contains(pd->_gameId))
- error("Duplicate game Id found - %s", pd->_gameId);
- map[pd->_gameId] = "";
+ for (const PlainGameDescriptor *pd = TADS2_GAME_LIST; pd->gameId; ++pd) {
+ if (map.contains(pd->gameId))
+ error("Duplicate game Id found - %s", pd->gameId);
+ map[pd->gameId] = "";
+ }
+ for (const PlainGameDescriptor *pd = TADS3_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/tads/detection_tables.h b/engines/glk/tads/detection_tables.h
index 322c9db..e9b4dc1 100644
--- a/engines/glk/tads/detection_tables.h
+++ b/engines/glk/tads/detection_tables.h
@@ -38,14 +38,15 @@ struct TADSGameDescription {
Common::Language _language;
};
-const GameDescriptor TADS_GAME_LIST[] = {
- // TADS 2 Games
- { "tads2", "TADS 2 Game", OPTION_TADS2 },
- { "oncefuture", "Once and Future", OPTION_TADS2 },
-
- // TADS 3 Games
- { "tads3", "TADS 3 Game", OPTION_TADS3 },
- { nullptr, nullptr, 0 }
+const PlainGameDescriptor TADS2_GAME_LIST[] = {
+ { "tads2", "TADS 2 Game" },
+ { "oncefuture", "Once and Future" },
+ { nullptr, nullptr }
+};
+
+const PlainGameDescriptor TADS3_GAME_LIST[] = {
+ { "tads3", "TADS 3 Game" },
+ { nullptr, nullptr }
};
#define ENTRY0(ID, MD5, FILESIZE) { ID, "", MD5, FILESIZE, Common::EN_ANY }
More information about the Scummvm-git-logs
mailing list