diff options
author | Nipun Garg | 2019-06-22 05:58:29 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:16:54 +0200 |
commit | dfa76fc545286fe806c4eb7d14864385a6d5785f (patch) | |
tree | 3096996bec5fed9ffa244c6923a88a9bbdbf4053 | |
parent | 204a9424cffcc34393a80df55b2238a423466d17 (diff) | |
download | scummvm-rg350-dfa76fc545286fe806c4eb7d14864385a6d5785f.tar.gz scummvm-rg350-dfa76fc545286fe806c4eb7d14864385a6d5785f.tar.bz2 scummvm-rg350-dfa76fc545286fe806c4eb7d14864385a6d5785f.zip |
HDB: Add _animTargets and related data
-rw-r--r-- | engines/hdb/ai-init.cpp | 2 | ||||
-rw-r--r-- | 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<AIEntity *>; _floats = new Common::Array<AIEntity *>; + _animTargets = new Common::Array<AnimTarget *>; 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<AIEntity *> *_ents; Common::Array<AIEntity *> *_floats; + Common::Array<AnimTarget *> *_animTargets; AIEntity *_player; // Cinematics Variables |