From 9865deb0bcd1948046607edab7647c2f328338bd Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Mon, 28 Jul 2003 01:50:45 +0000 Subject: bs2 svn-id: r9213 --- common/engine.cpp | 7 +++++++ common/engine.h | 11 ++++++++++- common/gameDetector.cpp | 12 ++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) (limited to 'common') 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 + } } -- cgit v1.2.3