diff options
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/scene.cpp | 16 | ||||
-rw-r--r-- | engines/sherlock/scene.h | 5 | ||||
-rw-r--r-- | engines/sherlock/sherlock.h | 2 |
3 files changed, 18 insertions, 5 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index abcf0d9d52..c377ab7f64 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -161,8 +161,16 @@ Scene *Scene::init(SherlockEngine *vm) { } Scene::Scene(SherlockEngine *vm): _vm(vm) { - for (int idx = 0; idx < SCENES_COUNT; ++idx) - Common::fill(&_sceneStats[idx][0], &_sceneStats[idx][65], false); + // TODO: _savedStats isn't ever used? + _sceneStats = new bool *[SCENES_COUNT]; + _savedStats = new bool *[SCENES_COUNT]; + _sceneStats[0] = new bool[SCENES_COUNT * 65]; + _savedStats[0] = new bool[SCENES_COUNT * 9]; + Common::fill(&_sceneStats[0][0], &_sceneStats[0][SCENES_COUNT * 65], false); + for (int idx = 1; idx < SCENES_COUNT; ++idx) { + _sceneStats[idx] = _sceneStats[idx - 1] + 65; + _savedStats[idx] = _savedStats[idx - 1] + 9; + } _currentScene = -1; _goToScene = -1; _loadingSavedGame = false; @@ -180,6 +188,10 @@ Scene::Scene(SherlockEngine *vm): _vm(vm) { Scene::~Scene() { freeScene(); + delete[] _sceneStats[0]; + delete[] _sceneStats; + delete[] _savedStats[0]; + delete[] _savedStats; } void Scene::selectScene() { diff --git a/engines/sherlock/scene.h b/engines/sherlock/scene.h index 0831de2c1f..1555e37282 100644 --- a/engines/sherlock/scene.h +++ b/engines/sherlock/scene.h @@ -33,7 +33,6 @@ namespace Sherlock { -#define SCENES_COUNT 63 #define MAX_ZONES 40 #define INFO_LINE 140 @@ -202,8 +201,8 @@ protected: public: int _currentScene; int _goToScene; - bool _sceneStats[SCENES_COUNT][65]; - bool _savedStats[SCENES_COUNT][9]; + bool **_sceneStats; + bool **_savedStats; bool _walkedInScene; int _version; bool _lzwMode; diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h index 75c8498e4e..a392e1d8b2 100644 --- a/engines/sherlock/sherlock.h +++ b/engines/sherlock/sherlock.h @@ -65,6 +65,8 @@ enum GameType { #define SHERLOCK_SCREEN_WIDTH _vm->_screen->w() #define SHERLOCK_SCREEN_HEIGHT _vm->_screen->h() #define SHERLOCK_SCENE_HEIGHT (IS_SERRATED_SCALPEL ? 138 : 480) +// TODO: Is this the correct scene count for The Case of the Rose Tattoo? +#define SCENES_COUNT (IS_SERRATED_SCALPEL ? 63 : 99) struct SherlockGameDescription; |