From 3fc0cb74b123bb6b854534fdc48a0ae4d9440710 Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Thu, 20 Jun 2019 19:03:40 +0530 Subject: HDB: Remove 'Cache Graphics for Inventory' stub --- engines/hdb/ai-funcs.cpp | 36 +++++++++++++++++++++++++++++++++++- engines/hdb/ai-init.cpp | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index 6ccc982761..b07399ffa1 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -551,7 +551,41 @@ void AI::initAllEnts() { } } - warning("STUB: initAllEnts: Cache graphics for Inventory and Deliveries"); + for (int i = 0; i < _numInventory; i++) { + AIEntity *temp = &_inventory[i].ent; + + // Clear out all ptrs in entity before writing + for (int j = 0; i < kMaxAnimFrames; i++) { + temp->blinkGfx[j] = NULL; + temp->movedownGfx[j] = NULL; + temp->moveupGfx[j] = NULL; + temp->moveleftGfx[j] = NULL; + temp->moverightGfx[j] = NULL; + temp->standdownGfx[j] = NULL; + temp->standupGfx[j] = NULL; + temp->standleftGfx[j] = NULL; + temp->standrightGfx[j] = NULL; + temp->special1Gfx[j] = NULL; + } + + temp->blinkFrames = 0; + temp->movedownFrames = 0; + temp->moveupFrames = 0; + temp->moveleftFrames = 0; + temp->moverightFrames = 0; + temp->standdownFrames = 0; + temp->standupFrames = 0; + temp->standleftFrames = 0; + temp->standrightFrames = 0; + + temp->draw = NULL; + temp->aiDraw = NULL; + temp->aiAction = temp->aiInit = temp->aiUse = NULL; + + cacheEntGfx(temp, false); + } + + warning("STUB: initAllEnts: Cache graphics for Deliveries"); warning("STUB: initAllEnts: LaserScan required"); } diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 812b51043f..fcb371a03b 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -669,7 +669,7 @@ AIEntTypeInfo aiEntList[] = { AI::AI() { _ents = new Common::Array; // REMOVE: Remove for final. Used here due to lack of a MENU - _numGems = _numGooCups = _numMonkeystones = 0; + _numGems = _numGooCups = _numMonkeystones = _numInventory = 0; } AI::~AI() { -- cgit v1.2.3