From dfa76fc545286fe806c4eb7d14864385a6d5785f Mon Sep 17 00:00:00 2001 From: Nipun Garg Date: Sat, 22 Jun 2019 05:58:29 +0530 Subject: HDB: Add _animTargets and related data --- engines/hdb/ai-init.cpp | 2 ++ engines/hdb/ai.h | 39 ++++++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp index 65240d1d19..22cf7297c7 100644 --- a/engines/hdb/ai-init.cpp +++ b/engines/hdb/ai-init.cpp @@ -669,6 +669,7 @@ AIEntTypeInfo aiEntList[] = { AI::AI() { _ents = new Common::Array; _floats = new Common::Array; + _animTargets = new Common::Array; for (int i = 0; i < kMaxLevel2Ents;i++) { _entsLevel2[i] = new AIEntLevel2; @@ -681,6 +682,7 @@ AI::AI() { AI::~AI() { delete _ents; delete _floats; + delete _animTargets; for (int i = 0; i < kMaxLevel2Ents;i++) { delete _entsLevel2[i]; } diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h index 7fcb6ab3a2..754dfdf29b 100644 --- a/engines/hdb/ai.h +++ b/engines/hdb/ai.h @@ -29,6 +29,7 @@ namespace HDB { enum { kMaxAnimFrames = 8, + kMaxAnimTFrames = 16, kMaxDeathFrames = 12, kMaxLevel2Ents = 60, kMaxInventory = 10, @@ -304,6 +305,12 @@ enum AIState { STATE_ENDSTATES }; +enum AnimSpeed { + ANIM_SLOW, + ANIM_NORMAL, + ANIM_FAST +}; + enum CineType { C_NO_COMMAND, C_STOPCINE, @@ -513,13 +520,6 @@ struct AIEntTypeInfo { extern AIEntTypeInfo aiEntList[]; -struct InvEnt { - uint16 keep; - AIEntity *ent; - - InvEnt() : keep(0), ent(NULL) {} -}; - struct AIEntLevel2 { uint16 x; uint16 y; @@ -531,6 +531,30 @@ struct AIEntLevel2 { AIEntLevel2() : x(0), y(0), draw(NULL), e(NULL), aiDraw(NULL), stunnedWait(0) {} }; +struct AnimTarget { + uint16 x, y; + uint16 start, end; + int16 vel; + uint16 animCycle; + uint16 animFrame; + bool killAuto; // Keep it alive if its an Auto? + bool inMap; + Tile *gfxList[kMaxAnimTFrames]; + + AnimTarget() : x(0), y(0), start(0), end(0), vel(0), animCycle(0), animFrame(0), killAuto(false), inMap(false) { + for (int i = 0; i < kMaxAnimTFrames;i++) { + gfxList[i] = new Tile; + } + } +}; + +struct InvEnt { + uint16 keep; + AIEntity *ent; + + InvEnt() : keep(0), ent(NULL) {} +}; + struct Waypoint { int x, y, level; @@ -881,6 +905,7 @@ private: Common::Array *_ents; Common::Array *_floats; + Common::Array *_animTargets; AIEntity *_player; // Cinematics Variables -- cgit v1.2.3