aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/glulxe
diff options
context:
space:
mode:
authorPaul Gilbert2018-12-14 18:25:20 -0800
committerPaul Gilbert2018-12-14 18:25:20 -0800
commitb84ee752cf50448590391b7c5e9f7ec448b9adfb (patch)
tree0ddaba980ca2ff929c14932d521ac9861ab900b5 /engines/glk/glulxe
parentc3bc9f80b5847eaa261d05fbc779675c99436f2c (diff)
downloadscummvm-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/glulxe')
-rw-r--r--engines/glk/glulxe/detection.cpp8
-rw-r--r--engines/glk/glulxe/detection.h6
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/glk/glulxe/detection.cpp b/engines/glk/glulxe/detection.cpp
index c2e19de4e9..fb701131ef 100644
--- a/engines/glk/glulxe/detection.cpp
+++ b/engines/glk/glulxe/detection.cpp
@@ -106,5 +106,13 @@ bool GlulxeMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &
return !gameList.empty();
}
+void GlulxeMetaEngine::detectClashes(Common::StringMap &map) {
+ for (const GlulxeDescriptor *pd = GLULXE_GAME_LIST; pd->gameId; ++pd) {
+ if (map.contains(pd->gameId))
+ error("Duplicate game Id found - %s", pd->gameId);
+ map[pd->gameId] = "";
+ }
+}
+
} // End of namespace Glulxe
} // End of namespace Glk
diff --git a/engines/glk/glulxe/detection.h b/engines/glk/glulxe/detection.h
index d6d5c6a9ad..654977a0b2 100644
--- a/engines/glk/glulxe/detection.h
+++ b/engines/glk/glulxe/detection.h
@@ -24,6 +24,7 @@
#define GLK_GLULXE_DETECTION
#include "common/fs.h"
+#include "common/hash-str.h"
#include "engines/game.h"
namespace Glk {
@@ -63,6 +64,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 Glulxe