diff options
-rw-r--r-- | engines/hdb/ai-funcs.cpp | 29 | ||||
-rw-r--r-- | engines/hdb/ai-init.cpp | 6 | ||||
-rw-r--r-- | engines/hdb/ai.h | 4 |
3 files changed, 38 insertions, 1 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index be0977e860..b35efdfc47 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -1225,7 +1225,34 @@ void AI::drawEnts(int x, int y, int w, int h) { } void AI::drawLevel2Ents() { - debug(9, "STUB: AI::drawLevel2Ents()"); + int debug = 0; //game.GetDebug(); // FIXME + + for (int i = 0; i < _numLevel2Ents; i++) { + // call custom drawing code? + if (_entsLevel2[i].aiDraw) + _entsLevel2[i].aiDraw(_entsLevel2[i].e, _entsLevel2[i].x, _entsLevel2[i].y); + else if (_entsLevel2[i].draw) + _entsLevel2[i].draw->drawMasked(_entsLevel2[i].x, _entsLevel2[i].y); + else if (debug) + _debugQMark->drawMasked(_entsLevel2[i].x, _entsLevel2[i].y ); + + if (_entsLevel2[i].stunnedWait) + g_hdb->_ai->_stunnedGfx[_stunAnim]->drawMasked(_entsLevel2[i].x , _entsLevel2[i].y); + } + + // always draw the player last + if (_player && _player->level == 2 && !_playerInvisible) { + int x, y; + g_hdb->_map->getMapXY(&x, &y); + + if (_player->draw) + _player->draw->drawMasked((_player->x - x) + _player->drawXOff, (_player->y - y) + _player->drawYOff); + } + + if (_stunTimer < g_system->getMillis()) { + _stunAnim = (_stunAnim + 1) & 3; + _stunTimer = g_system->getMillis() + 100; + } } void AI::animGrabbing() { diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 8f4ed860ec..cc5bd9490b 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -673,6 +673,9 @@ AI::AI() { // REMOVE: Remove for final. Used here due to lack of a MENU _numGems = _numGooCups = _numMonkeystones = _numInventory = 0; + + _stunAnim = 0; + _stunTimer = g_system->getMillis(); } AI::~AI() { @@ -684,6 +687,9 @@ AI::~AI() { bool AI::init() { warning("STUB: AI::init incomplete"); + _debugQMark = new Tile; + _debugQMark->load(g_hdb->_fileMan->findFirstData("icon_question_mark", TYPE_ICON32)); + // Clear Waypoint list and load Waypoint graphics _numWaypoints = 0; _waypointGfx[0] = new Tile; diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index b64b2aba48..32cca0a96f 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -923,6 +923,7 @@ public: Waypoint _waypoints[kMaxWaypoints]; int _numWaypoints; Tile *_waypointGfx[4]; // Animating waypoint gfx + Tile *_debugQMark; ActionInfo _actions[kMaxActions]; @@ -940,6 +941,9 @@ public: CineBlit *_cineBlitList[kMaxCineGfx]; int _numCineBlitList; + int _stunAnim; + uint32 _stunTimer; + private: // Action Functions |