diff options
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/sherlock/scene.cpp | 13 | ||||
| -rw-r--r-- | engines/sherlock/sherlock.h | 1 | 
2 files changed, 8 insertions, 6 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index 592c96f527..f56a5109f5 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -207,11 +207,12 @@ Scene *Scene::init(SherlockEngine *vm) {  Scene::Scene(SherlockEngine *vm): _vm(vm) {  	_sceneStats = new bool *[SCENES_COUNT]; -	_sceneStats[0] = new bool[SCENES_COUNT * 65]; -	Common::fill(&_sceneStats[0][0], &_sceneStats[0][SCENES_COUNT * 65], false); +	_sceneStats[0] = new bool[SCENES_COUNT * (MAX_BGSHAPES + 1)]; +	Common::fill(&_sceneStats[0][0], &_sceneStats[0][SCENES_COUNT * (MAX_BGSHAPES + 1)], false);  	for (int idx = 1; idx < SCENES_COUNT; ++idx) { -		_sceneStats[idx] = _sceneStats[idx - 1] + 65; +		_sceneStats[idx] = _sceneStats[idx - 1] + (MAX_BGSHAPES + 1);  	} +  	_currentScene = -1;  	_goToScene = -1;  	_loadingSavedGame = false; @@ -1050,7 +1051,7 @@ void Scene::loadSceneSounds() {  }  void Scene::checkSceneStatus() { -	if (_sceneStats[_currentScene][64]) { +	if (_sceneStats[_currentScene][MAX_BGSHAPES]) {  		for (uint idx = 0; idx < 64; ++idx) {  			bool flag = _sceneStats[_currentScene][idx]; @@ -1076,7 +1077,7 @@ void Scene::checkSceneStatus() {  void Scene::saveSceneStatus() {  	// Flag any objects for the scene that have been altered -	int count = MIN((int)_bgShapes.size(), 64); +	int count = MIN((int)_bgShapes.size(), MAX_BGSHAPES);  	for (int idx = 0; idx < count; ++idx) {  		Object &obj = _bgShapes[idx];  		_sceneStats[_currentScene][idx] = obj._type == HIDDEN || obj._type == REMOVE @@ -1380,7 +1381,7 @@ void Scene::synchronize(Serializer &s) {  	}  	for (int sceneNum = 0; sceneNum < SCENES_COUNT; ++sceneNum) { -		for (int flag = 0; flag < 65; ++flag) { +		for (int flag = 0; flag <= MAX_BGSHAPES; ++flag) {  			s.syncAsByte(_sceneStats[sceneNum][flag]);  		}  	} diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h index 5f888f8c3d..ab2c8be6b6 100644 --- a/engines/sherlock/sherlock.h +++ b/engines/sherlock/sherlock.h @@ -68,6 +68,7 @@ enum GameType {  #define SHERLOCK_SCENE_WIDTH _vm->_screen->_backBuffer1.w()  #define SHERLOCK_SCENE_HEIGHT (IS_SERRATED_SCALPEL ? 138 : 480)  #define SCENES_COUNT (IS_SERRATED_SCALPEL ? 63 : 101) +#define MAX_BGSHAPES (IS_SERRATED_SCALPEL ? 64 : 150)  #define COL_INFO_FOREGROUND (IS_SERRATED_SCALPEL ? (byte)Scalpel::INFO_FOREGROUND : (byte)Tattoo::INFO_FOREGROUND)  #define COL_PEN_COLOR (IS_SERRATED_SCALPEL ? (byte)Scalpel::PEN_COLOR : (byte)Tattoo::PEN_COLOR)  | 
