22 #ifndef WORLD_ACTORS_ANIMACTION_H 23 #define WORLD_ACTORS_ANIMACTION_H 25 #include "ultima/shared/std/containers.h" 26 #include "ultima/ultima8/misc/direction.h" 42 AFF_ONGROUND = 0x00000002,
43 AFF_FLIPPED = 0x00000020,
44 AFF_SPECIAL = 0x00000800,
45 AFF_HURTY = 0x00001000,
46 AFF_USECODE = 0x00004000,
47 AFF_CRUFLIP = 0x00008000
52 inline bool is_onground()
const {
53 return (_flags & AFF_ONGROUND) != 0;
56 inline bool is_flipped()
const {
57 return (_flags & AFF_FLIPPED) != 0;
60 inline bool is_callusecode()
const {
61 return (_flags & AFF_USECODE) != 0;
64 inline bool is_cruflipped()
const {
65 return (_flags & AFF_CRUFLIP) != 0;
68 inline int attack_range()
const {
69 return ((_flags >> 2) & 0x07);
74 inline int cru_attackx()
const {
75 uint32 rawx = (_flags & 0x00000780) << 5;
76 int16 signedx =
static_cast<int16
>(rawx) >> 12;
80 inline int cru_attacky()
const {
81 uint32 rawy = (_flags & 0x00F00000) >> 16;
82 return static_cast<int8
>(rawy);
85 inline int cru_attackz()
const {
86 return (_flags & 0x0F000000) >> 21;
89 inline bool is_cruattack()
const {
90 return (cru_attackx() || cru_attacky() || cru_attackz());
103 void getAnimRange(
const Actor *actor, Direction dir,
104 unsigned int &startframe,
unsigned int &endframe)
const;
113 void getAnimRange(
unsigned int lastanim, Direction lastdir,
114 bool firststep, Direction dir,
115 unsigned int &startframe,
unsigned int &endframe)
const;
117 unsigned int getDirCount()
const {
121 unsigned int getSize()
const {
125 int getFrameRepeat()
const {
129 uint32 getShapeNum()
const {
133 uint32 getAction()
const {
137 bool hasFlags(uint32 mask)
const {
138 return (_flags & mask) != 0;
141 uint32 getFlags()
const {
145 const AnimFrame &getFrame(Direction dir,
unsigned int frameno)
const;
156 AAF_TWOSTEP = 0x0001,
158 AAF_LOOPING = 0x0004,
159 AAF_UNSTOPPABLE = 0x0008,
160 AAF_LOOPING2_U8 = 0x0010,
161 AAF_ENDLOOP_U8 = 0x0020,
162 AAF_ENDLOOP_CRU = 0x0040,
163 AAF_HANGING = 0x0080,
165 AAF_DESTROYACTOR = 0x8000,
166 AAF_ROTATED = 0x10000,
167 AAF_COMMONFLAGS = (AAF_TWOSTEP | AAF_LOOPING | AAF_UNSTOPPABLE | AAF_HANGING | AAF_DESTROYACTOR)
182 unsigned int _dirCount;
Definition: anim_action.h:94
AnimFrameFlags
Definition: anim_action.h:41
Definition: detection.h:27
Definition: anim_dat.h:35
Definition: anim_action.h:33
AnimActionFlags
Definition: anim_action.h:154
Definition: containers.h:38