HDB: More var initialisation

This commit is contained in:
Eugene Sandulenko 2019-07-17 19:55:12 +02:00
parent d3ad2ed14a
commit ff2c6fe30a
3 changed files with 7 additions and 4 deletions

View File

@ -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");

View File

@ -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
}
}

View File

@ -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)