aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-07-17 19:55:12 +0200
committerEugene Sandulenko2019-09-03 17:17:22 +0200
commitff2c6fe30a7aba9021f10abb64483a0c1857c077 (patch)
treea034dd48eaa1adfd19d1954d74c304e6a7c78d0a
parentd3ad2ed14aa6ec6495f858a849a5346beda911ff (diff)
downloadscummvm-rg350-ff2c6fe30a7aba9021f10abb64483a0c1857c077.tar.gz
scummvm-rg350-ff2c6fe30a7aba9021f10abb64483a0c1857c077.tar.bz2
scummvm-rg350-ff2c6fe30a7aba9021f10abb64483a0c1857c077.zip
HDB: More var initialisation
-rw-r--r--engines/hdb/ai-init.cpp4
-rw-r--r--engines/hdb/gfx.cpp5
-rw-r--r--engines/hdb/map.cpp2
3 files changed, 7 insertions, 4 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index 9c7aea4c47..ec6403a955 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -948,8 +948,8 @@ bool AI::init() {
_useSwitchOn = g_hdb->_gfx->getTileIndex("t32_switch_on");
_useSwitch2Off = g_hdb->_gfx->getTileIndex("anim_t32_1switch_off01");
_useSwitch2On = g_hdb->_gfx->getTileIndex("t32_1switch_on");
-// _useHandswitchOn = g_hdb->_gfx->getTileIndex("t32_ship_handswitch_on");
-// _useHandswitchOff = g_hdb->_gfx->getTileIndex("anim_t32_ship_handswitch_off1");
+ _useHandswitchOn = g_hdb->_gfx->getTileIndex("t32_ship_handswitch_on");
+ _useHandswitchOff = g_hdb->_gfx->getTileIndex("anim_t32_ship_handswitch_off1");
_useHolderEmpty = g_hdb->_gfx->getTileIndex("anim_t32_holder_empty1");
_useHolderFull = g_hdb->_gfx->getTileIndex("t32_holder_full");
_useMailsorter = g_hdb->_gfx->getTileIndex("anim_t32_mailsort1");
diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp
index 8b2ac3dc62..b497b53b05 100644
--- a/engines/hdb/gfx.cpp
+++ b/engines/hdb/gfx.cpp
@@ -34,8 +34,11 @@ Gfx::Gfx() {
_cosines = new Common::CosineTable(360);
_systemInit = false;
+ _numTiles = 0;
+
memset(&_fadeInfo, 0, sizeof(_fadeInfo));
memset(&_snowInfo, 0, sizeof(_snowInfo));
+ memset(&_skyTiles, 0, sizeof(_skyTiles));
}
Gfx::~Gfx() {
@@ -574,7 +577,7 @@ int Gfx::isSky(int index) {
}
for (int i = 0; i < kMaxSkies; i++) {
- if(_skyTiles[i] == index) {
+ if (_skyTiles[i] == index) {
return i + 1; // The skyTiles are indexed from 1. 0 => No Sky tile
}
}
diff --git a/engines/hdb/map.cpp b/engines/hdb/map.cpp
index 195b673e31..a17b0db1f1 100644
--- a/engines/hdb/map.cpp
+++ b/engines/hdb/map.cpp
@@ -1169,7 +1169,7 @@ bool Map::checkXYOnScreen(int x, int y) {
}
bool Map::checkOneTileExistInRange(int tileIndex, int count) {
- for (int i = 0; i < _width*_height; i++) {
+ for (int i = 0; i < _width * _height; i++) {
if (_background[i] >= tileIndex && _background[i] < tileIndex + count)
return true;
if (_foreground[i] >= tileIndex && _foreground[i] < tileIndex + count)