diff options
author | Paul Gilbert | 2018-12-31 19:47:14 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-31 19:47:14 -0800 |
commit | 013f39cb5d7029e9569861034661770d1578847e (patch) | |
tree | a8796b50ce79001dc04dcc9db7e661f5d928fead /engines/glk/glulxe | |
parent | 84b6534c3fcf3315ed1c7fe3cabbdd167fc748a9 (diff) | |
download | scummvm-rg350-013f39cb5d7029e9569861034661770d1578847e.tar.gz scummvm-rg350-013f39cb5d7029e9569861034661770d1578847e.tar.bz2 scummvm-rg350-013f39cb5d7029e9569861034661770d1578847e.zip |
GLK: Standardizing on a common GameDescriptor class for detectors
Diffstat (limited to 'engines/glk/glulxe')
-rw-r--r-- | engines/glk/glulxe/detection.cpp | 10 | ||||
-rw-r--r-- | engines/glk/glulxe/detection.h | 18 | ||||
-rw-r--r-- | engines/glk/glulxe/detection_tables.h | 2 |
3 files changed, 8 insertions, 22 deletions
diff --git a/engines/glk/glulxe/detection.cpp b/engines/glk/glulxe/detection.cpp index 09b6e97d0b..06ce40362d 100644 --- a/engines/glk/glulxe/detection.cpp +++ b/engines/glk/glulxe/detection.cpp @@ -31,18 +31,18 @@ namespace Glk { namespace Glulxe { void GlulxeMetaEngine::getSupportedGames(PlainGameList &games) { - for (const GlulxeDescriptor *pd = GLULXE_GAME_LIST; pd->gameId; ++pd) { + for (const PlainGameDescriptor *pd = GLULXE_GAME_LIST; pd->gameId; ++pd) { games.push_back(*pd); } } -GlulxeDescriptor GlulxeMetaEngine::findGame(const char *gameId) { - for (const GlulxeDescriptor *pd = GLULXE_GAME_LIST; pd->gameId; ++pd) { +GameDescriptor GlulxeMetaEngine::findGame(const char *gameId) { + for (const PlainGameDescriptor *pd = GLULXE_GAME_LIST; pd->gameId; ++pd) { if (!strcmp(gameId, pd->gameId)) return *pd; } - return GlulxeDescriptor(); + return GameDescriptor::empty(); } bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) { @@ -107,7 +107,7 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames & } void GlulxeMetaEngine::detectClashes(Common::StringMap &map) { - for (const GlulxeDescriptor *pd = GLULXE_GAME_LIST; pd->gameId; ++pd) { + for (const PlainGameDescriptor *pd = GLULXE_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/glulxe/detection.h b/engines/glk/glulxe/detection.h index 654977a0b2..9c38354f98 100644 --- a/engines/glk/glulxe/detection.h +++ b/engines/glk/glulxe/detection.h @@ -26,26 +26,12 @@ #include "common/fs.h" #include "common/hash-str.h" #include "engines/game.h" +#include "glk/detection.h" namespace Glk { namespace Glulxe { /** - * Glulxe game descriptior - */ -struct GlulxeDescriptor { - const char *gameId; - const char *description; - - operator PlainGameDescriptor() const { - PlainGameDescriptor pd; - pd.gameId = gameId; - pd.description = description; - return pd; - } -}; - -/** * Meta engine for Glulxe interpreter */ class GlulxeMetaEngine { @@ -58,7 +44,7 @@ public: /** * Returns a game description for the given game Id, if it's supported */ - static GlulxeDescriptor findGame(const char *gameId); + static GameDescriptor findGame(const char *gameId); /** * Detect supported games diff --git a/engines/glk/glulxe/detection_tables.h b/engines/glk/glulxe/detection_tables.h index 17c5ffd55b..cdbe228bce 100644 --- a/engines/glk/glulxe/detection_tables.h +++ b/engines/glk/glulxe/detection_tables.h @@ -38,7 +38,7 @@ struct GlulxeGameDescription { Common::Language _language; }; -const GlulxeDescriptor GLULXE_GAME_LIST[] = { +const PlainGameDescriptor GLULXE_GAME_LIST[] = { { "glulxe", "Glulxe Game" }, { "cragne", "Cragne Manor" }, |