aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/engine.cpp7
-rw-r--r--common/engine.h11
-rw-r--r--common/gameDetector.cpp12
3 files changed, 29 insertions, 1 deletions
diff --git a/common/engine.cpp b/common/engine.cpp
index 0600f3a0d8..71f3254d12 100644
--- a/common/engine.cpp
+++ b/common/engine.cpp
@@ -144,6 +144,13 @@ Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) {
}
#endif
+#ifndef DISABLE_BS2
+ if (detector->_game.id >= GID_BS2_FIRST && detector->_game.id <= GID_BS2_LAST) {
+ // Broken Sword 2
+ engine = Engine_BS2_create(detector, syst);
+ }
+#endif
+
return engine;
}
diff --git a/common/engine.h b/common/engine.h
index f9d7fb9902..5015f670e8 100644
--- a/common/engine.h
+++ b/common/engine.h
@@ -38,7 +38,11 @@ enum GameId {
// Beneath a Steel Sky
GID_SKY_FIRST,
- GID_SKY_LAST = GID_SKY_FIRST + 49
+ GID_SKY_LAST = GID_SKY_FIRST + 49,
+
+ // Broken Sword 2
+ GID_BS2_FIRST,
+ GID_BS2_LAST = GID_BS2_FIRST + 49
};
@@ -112,5 +116,10 @@ extern const VersionSettings *Engine_SKY_targetList();
extern Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst);
#endif
+#ifndef DISABLE_BS2
+extern const VersionSettings *Engine_BS2_targetList();
+extern Engine *Engine_BS2_create(GameDetector *detector, OSystem *syst);
+#endif
+
#endif
diff --git a/common/gameDetector.cpp b/common/gameDetector.cpp
index 7e04296129..7b96c857d6 100644
--- a/common/gameDetector.cpp
+++ b/common/gameDetector.cpp
@@ -223,6 +223,12 @@ GameDetector::GameDetector() {
int skyCount = countVersions(skyVersions);
totalCount += skyCount;
#endif
+
+#ifndef DISABLE_BS2
+ const VersionSettings *bs2Versions = Engine_BS2_targetList();
+ int bs2Count = countVersions(bs2Versions);
+ totalCount += bs2Count;
+#endif
VersionSettings *v = (VersionSettings *)calloc(totalCount + 1, sizeof(VersionSettings));
version_settings = v;
@@ -241,6 +247,12 @@ GameDetector::GameDetector() {
memcpy(v, skyVersions, skyCount * sizeof(VersionSettings));
v += skyCount;
#endif
+
+#ifndef DISABLE_BS2
+ memcpy(v, bs2Versions, bs2Count * sizeof(VersionSettings));
+ v += bs2Count;
+#endif
+
}
}