diff options
-rw-r--r-- | engines/hdb/ai-init.cpp | 28 | ||||
-rw-r--r-- | engines/hdb/ai.h | 3 | ||||
-rw-r--r-- | engines/hdb/gfx.cpp | 6 | ||||
-rw-r--r-- | engines/hdb/menu.cpp | 3 |
4 files changed, 18 insertions, 22 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index e69fbc709a..0471a05212 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -988,9 +988,6 @@ AI::~AI() { for (uint i = 0; i < _animTargets.size(); i++) { delete _animTargets[i]; } - - // Free Animating Tiles - freeAnimInfo(); } bool AI::init() { @@ -1780,13 +1777,13 @@ void AI::loadSaveFile(Common::InSaveFile *in) { void AI::initAnimInfo() { if (g_hdb->_map->checkOneTileExistInRange(_useSwitchOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_useSwitchOn)); + g_hdb->_gfx->getTile(_useSwitchOn); if (g_hdb->_map->checkOneTileExistInRange(_useSwitch2Off, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_useSwitch2On)); + g_hdb->_gfx->getTile(_useSwitch2On); if (g_hdb->_map->checkOneTileExistInRange(_useHolderEmpty, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_useHolderFull)); + g_hdb->_gfx->getTile(_useHolderFull); if (g_hdb->_map->checkOneTileExistInRange(_useHandswitchOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_useHandswitchOn)); + g_hdb->_gfx->getTile(_useHandswitchOn); if (g_hdb->_map->checkOneTileExistInRange(_targetDoorN, 4)) g_hdb->_gfx->cacheTileSequence(_targetDoorN, 4); @@ -1860,22 +1857,17 @@ void AI::initAnimInfo() { g_hdb->_gfx->cacheTileSequence(_blockpole, 4); if (g_hdb->_map->checkOneTileExistInRange(_kcHolderWhiteOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_kcHolderWhiteOn)); + g_hdb->_gfx->getTile(_kcHolderWhiteOn); if (g_hdb->_map->checkOneTileExistInRange(_kcHolderBlueOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_kcHolderBlueOn)); + g_hdb->_gfx->getTile(_kcHolderBlueOn); if (g_hdb->_map->checkOneTileExistInRange(_kcHolderRedOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_kcHolderRedOn)); + g_hdb->_gfx->getTile(_kcHolderRedOn); if (g_hdb->_map->checkOneTileExistInRange(_kcHolderGreenOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_kcHolderGreenOn)); + g_hdb->_gfx->getTile(_kcHolderGreenOn); if (g_hdb->_map->checkOneTileExistInRange(_kcHolderPurpleOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_kcHolderPurpleOn)); + g_hdb->_gfx->getTile(_kcHolderPurpleOn); if (g_hdb->_map->checkOneTileExistInRange(_kcHolderBlackOff, 2)) - _animTiles.push_back(g_hdb->_gfx->getTile(_kcHolderBlackOn)); -} - -void AI::freeAnimInfo() { - for (uint i = 0; i < _animTiles.size(); i++) - delete _animTiles[i]; + g_hdb->_gfx->getTile(_kcHolderBlackOn); } const char *AITypeStr[] = { diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index df888b162c..83fe88b9ff 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -821,7 +821,6 @@ public: void save(Common::OutSaveFile *out); void loadSaveFile(Common::InSaveFile *in); void initAnimInfo(); - void freeAnimInfo(); // Entity Functions AIEntity *spawn(AIType type, AIDir dir, int x, int y, const char *funcInit, const char *funcAction, const char *funcUse, AIDir dir2, int level, int value1, int value2, int callInit); @@ -1328,8 +1327,6 @@ public: Tile *_gfxLaserbeamLRLeft[4]; Tile *_gfxLaserbeamLRRight[4]; - Common::Array<Tile *> _animTiles; - private: // Action Functions diff --git a/engines/hdb/gfx.cpp b/engines/hdb/gfx.cpp index d3e5e75df2..e60a7ba2ab 100644 --- a/engines/hdb/gfx.cpp +++ b/engines/hdb/gfx.cpp @@ -58,6 +58,10 @@ Gfx::~Gfx() { for (int i = 0; i < _fontHeader.numChars; i++) _fontSurfaces[i].free(); _globalSurface.free(); + for (int i = 0; i < _numTiles; i++) { + delete _tLookupArray[i].tData; + _tLookupArray[i].tData = NULL; + } delete[] _tLookupArray; for (int i = 0; i < 8; i++) delete _mousePointer[i]; @@ -459,7 +463,7 @@ void Gfx::emptyGfxCaches() { void Gfx::cacheTileSequence(int tileIndex, int count) { for (int i = tileIndex; i < tileIndex + count; i++) - g_hdb->_ai->_animTiles.push_back(getTile(i)); + getTile(i); } int Gfx::getTileIndex(const char *name) { diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp index a3c6b8ec29..ffcf673723 100644 --- a/engines/hdb/menu.cpp +++ b/engines/hdb/menu.cpp @@ -680,6 +680,9 @@ void Menu::freeMenu() { if (_menuBackoutGfx) delete _menuBackoutGfx; _menuBackoutGfx = NULL; + if (_menuBackspaceGfx) + delete _menuBackspaceGfx; + _menuBackspaceGfx = NULL; if (_controlButtonGfx) delete _controlButtonGfx; |