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/alan2 | |
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/alan2')
-rw-r--r-- | engines/glk/alan2/detection.cpp | 10 | ||||
-rw-r--r-- | engines/glk/alan2/detection.h | 18 | ||||
-rw-r--r-- | engines/glk/alan2/detection_tables.h | 3 |
3 files changed, 8 insertions, 23 deletions
diff --git a/engines/glk/alan2/detection.cpp b/engines/glk/alan2/detection.cpp index 175c3d61fc..fab511772b 100644 --- a/engines/glk/alan2/detection.cpp +++ b/engines/glk/alan2/detection.cpp @@ -31,18 +31,18 @@ namespace Glk { namespace Alan2 { void Alan2MetaEngine::getSupportedGames(PlainGameList &games) { - for (const Alan2Descriptor *pd = ALAN2_GAME_LIST; pd->gameId; ++pd) { + for (const PlainGameDescriptor *pd = ALAN2_GAME_LIST; pd->gameId; ++pd) { games.push_back(*pd); } } -Alan2Descriptor Alan2MetaEngine::findGame(const char *gameId) { - for (const Alan2Descriptor *pd = ALAN2_GAME_LIST; pd->gameId; ++pd) { +GameDescriptor Alan2MetaEngine::findGame(const char *gameId) { + for (const PlainGameDescriptor *pd = ALAN2_GAME_LIST; pd->gameId; ++pd) { if (!strcmp(gameId, pd->gameId)) return *pd; } - return Alan2Descriptor(); + return GameDescriptor::empty(); } bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &gameList) { @@ -107,7 +107,7 @@ bool Alan2MetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g } void Alan2MetaEngine::detectClashes(Common::StringMap &map) { - for (const Alan2Descriptor *pd = ALAN2_GAME_LIST; pd->gameId; ++pd) { + for (const PlainGameDescriptor *pd = ALAN2_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/alan2/detection.h b/engines/glk/alan2/detection.h index b3fa3bd473..b5587095d0 100644 --- a/engines/glk/alan2/detection.h +++ b/engines/glk/alan2/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 Alan2 { /** - * Alan2 game descriptior - */ -struct Alan2Descriptor { - const char *gameId; - const char *description; - - operator PlainGameDescriptor() const { - PlainGameDescriptor pd; - pd.gameId = gameId; - pd.description = description; - return pd; - } -}; - -/** * Meta engine for Alan2 interpreter */ class Alan2MetaEngine { @@ -58,7 +44,7 @@ public: /** * Returns a game description for the given game Id, if it's supported */ - static Alan2Descriptor findGame(const char *gameId); + static GameDescriptor findGame(const char *gameId); /** * Detect supported games diff --git a/engines/glk/alan2/detection_tables.h b/engines/glk/alan2/detection_tables.h index 2a09a02ed0..c6426520d8 100644 --- a/engines/glk/alan2/detection_tables.h +++ b/engines/glk/alan2/detection_tables.h @@ -38,9 +38,8 @@ struct Alan2GameDescription { Common::Language _language; }; -const Alan2Descriptor ALAN2_GAME_LIST[] = { +const PlainGameDescriptor ALAN2_GAME_LIST[] = { { "alan2", "Alan2 Game" }, - //{ "cragne", "Cragne Manor" }, { nullptr, nullptr } }; |