aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-03-20 19:28:05 +0100
committerStrangerke2014-03-20 19:28:05 +0100
commite324f3e6be23ff3c415a22ec2cb2596dbdec2bfc (patch)
tree52b38aa8a03ca3b58bc240e31da6aea55fc40c72
parent3464bc20517006270ddc988a1505ce6cecc71f31 (diff)
downloadscummvm-rg350-e324f3e6be23ff3c415a22ec2cb2596dbdec2bfc.tar.gz
scummvm-rg350-e324f3e6be23ff3c415a22ec2cb2596dbdec2bfc.tar.bz2
scummvm-rg350-e324f3e6be23ff3c415a22ec2cb2596dbdec2bfc.zip
BVBS: Fix some uninitialized variables
-rw-r--r--engines/bbvs/bbvs.cpp37
-rw-r--r--engines/bbvs/bbvs.h1
-rw-r--r--engines/bbvs/walk.cpp2
3 files changed, 37 insertions, 3 deletions
diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index 8bcc4d3809..ed5963ae08 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 8136184e0b..958d315964 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 cabe402a46..cf8942e525 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;