diff options
author | Paul Gilbert | 2018-12-14 18:25:20 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-14 18:25:20 -0800 |
commit | b84ee752cf50448590391b7c5e9f7ec448b9adfb (patch) | |
tree | 0ddaba980ca2ff929c14932d521ac9861ab900b5 /engines/glk/scott | |
parent | c3bc9f80b5847eaa261d05fbc779675c99436f2c (diff) | |
download | scummvm-rg350-b84ee752cf50448590391b7c5e9f7ec448b9adfb.tar.gz scummvm-rg350-b84ee752cf50448590391b7c5e9f7ec448b9adfb.tar.bz2 scummvm-rg350-b84ee752cf50448590391b7c5e9f7ec448b9adfb.zip |
GLK: Detect game Id clashes across different sub-engines
Diffstat (limited to 'engines/glk/scott')
-rw-r--r-- | engines/glk/scott/detection.cpp | 8 | ||||
-rw-r--r-- | engines/glk/scott/detection.h | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/glk/scott/detection.cpp b/engines/glk/scott/detection.cpp index a02e3c56ad..6c04a25646 100644 --- a/engines/glk/scott/detection.cpp +++ b/engines/glk/scott/detection.cpp @@ -77,5 +77,13 @@ bool ScottMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g return !gameList.empty(); } +void ScottMetaEngine::detectClashes(Common::StringMap &map) { + for (const PlainGameDescriptor *pd = SCOTT_GAME_LIST; pd->gameId; ++pd) { + if (map.contains(pd->gameId)) + error("Duplicate game Id found - %s", pd->gameId); + map[pd->gameId] = ""; + } +} + } // End of namespace Scott } // End of namespace Glk diff --git a/engines/glk/scott/detection.h b/engines/glk/scott/detection.h index 384197c467..709b7de1d9 100644 --- a/engines/glk/scott/detection.h +++ b/engines/glk/scott/detection.h @@ -24,6 +24,7 @@ #define GLK_SCOTT_DETECTION #include "common/fs.h" +#include "common/hash-str.h" #include "engines/game.h" namespace Glk { @@ -45,6 +46,11 @@ public: * Detect supported games */ static bool detectGames(const Common::FSList &fslist, DetectedGames &gameList); + + /** + * Check for game Id clashes with other sub-engines + */ + static void detectClashes(Common::StringMap &map); }; } // End of namespace Scott |