From ff2c6fe30a7aba9021f10abb64483a0c1857c077 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 17 Jul 2019 19:55:12 +0200 Subject: HDB: More var initialisation --- engines/hdb/ai-init.cpp | 4 ++-- engines/hdb/gfx.cpp | 5 ++++- engines/hdb/map.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'engines/hdb') 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) -- cgit v1.2.3