[Scummvm-cvs-logs] scummvm master -> e324f3e6be23ff3c415a22ec2cb2596dbdec2bfc

Strangerke Strangerke at scummvm.org
Thu Mar 20 19:30:01 CET 2014


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:
e324f3e6be BVBS: Fix some uninitialized variables


Commit: e324f3e6be23ff3c415a22ec2cb2596dbdec2bfc
    https://github.com/scummvm/scummvm/commit/e324f3e6be23ff3c415a22ec2cb2596dbdec2bfc
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-03-20T19:28:05+01:00

Commit Message:
BVBS: Fix some uninitialized variables

Changed paths:
    engines/bbvs/bbvs.cpp
    engines/bbvs/bbvs.h
    engines/bbvs/walk.cpp



diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index 8bcc4d3..ed5963a 100644
--- a/engines/bbvs/bbvs.cpp
+++ b/engines/bbvs/bbvs.cpp
@@ -79,7 +79,42 @@ BbvsEngine::BbvsEngine(OSystem *syst, const ADGameDescription *gd) :
 	Engine(syst), _gameDescription(gd) {
 	
 	_random = new Common::RandomSource("bbvs");
-	
+	_currActionCommandIndex = -1;
+	_buttheadObject = nullptr;
+	_beavisObject = nullptr;
+	_currCameraNum = 0;
+	_walkAreasCount = 0;
+	_walkInfosCount = 0;
+	_walkableRectsCount = 0;
+	_sourceWalkArea = nullptr;
+	_destWalkArea = nullptr;
+	_currWalkDistance = kMaxDistance;
+	_walkReachedDestArea = false;
+	_hasSnapshot = false;
+	_snapshotSize = 0;
+	_snapshot = nullptr;
+	_snapshotStream = nullptr;
+	_isSaveAllowed = false;
+
+	for (int i = 0; i < 80; i++) {
+		_walkAreas[i].x = 0;
+		_walkAreas[i].y = 0;
+		_walkAreas[i].width = 0;
+		_walkAreas[i].height = 0;
+		_walkAreas[i].checked = false;
+		_walkAreas[i].linksCount = 0;
+		for (int j = 0; j < 16; j++)
+			_walkAreas[i].links[j] = nullptr;
+		for (int j = 0; j < 32; j++) {
+			_walkAreas[i].linksD1[j] = nullptr;
+			_walkAreas[i].linksD2[j] = nullptr;
+		}
+	}
+
+	for (int i = 0; i < 256; i++) {
+		_walkInfoPtrs[i] = nullptr;
+	}
+
 	Engine::syncSoundSettings();
 
 }
diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h
index 8136184..958d315 100644
--- a/engines/bbvs/bbvs.h
+++ b/engines/bbvs/bbvs.h
@@ -209,6 +209,7 @@ const int kSceneVisitedCount = 64;
 const int kMainMenu = 44;
 const int kCredits  = 45;
 
+const int kMaxDistance = 0xFFFFFF;
 static const int8 kWalkTurnTbl[] = {
 	7, 9, 4, 8, 6, 10, 5, 11
 };
diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp
index cabe402..cf8942e 100644
--- a/engines/bbvs/walk.cpp
+++ b/engines/bbvs/walk.cpp
@@ -44,8 +44,6 @@ static const int8 kWalkAnimTbl[32] = {
 };
 
 void BbvsEngine::startWalkObject(SceneObject *sceneObject) {
-	const int kMaxDistance = 0xFFFFFF;
-
 	if (_buttheadObject != sceneObject && _beavisObject != sceneObject)
 		return;
 	






More information about the Scummvm-git-logs mailing list