[Scummvm-cvs-logs] scummvm master -> 7648a70eb45ad1b000b3bfbb140d77dbbe176c0d

dreammaster dreammaster at scummvm.org
Sun Jul 26 22:41:33 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7648a70eb4 SHERLOCK: RT: Increase size of _sceneStats


Commit: 7648a70eb45ad1b000b3bfbb140d77dbbe176c0d
    https://github.com/scummvm/scummvm/commit/7648a70eb45ad1b000b3bfbb140d77dbbe176c0d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-26T16:40:34-04:00

Commit Message:
SHERLOCK: RT: Increase size of _sceneStats

Changed paths:
    engines/sherlock/scene.cpp
    engines/sherlock/sherlock.h



diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 592c96f..f56a510 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 5f888f8..ab2c8be 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)






More information about the Scummvm-git-logs mailing list