00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ANIMACTION_H
00020 #define ANIMACTION_H
00021
00022 #include <vector>
00023 class Actor;
00024
00025 struct AnimFrame
00026 {
00027 int frame;
00028 int deltaz;
00029 int deltadir;
00030 int sfx;
00031 uint32 flags;
00032
00033 enum AnimFrameFlags {
00034 AFF_UNK1 = 0x0001,
00035 AFF_ONGROUND = 0x0002,
00036 AFF_FLIPPED = 0x0020,
00037 AFF_SPECIAL = 0x0800
00038 };
00039
00040 inline bool is_flipped() { return (flags & AFF_FLIPPED) != 0; }
00041 inline int attack_range() { return ((flags >> 2) & 0x07); }
00042 };
00043
00044 struct AnimAction {
00045 uint32 shapenum;
00046 uint32 action;
00047
00048 std::vector<AnimFrame> frames[16];
00049 unsigned int size;
00050 int framerepeat;
00051 uint32 flags;
00052
00053 unsigned int dircount;
00054
00060 void getAnimRange(Actor* actor, int dir,
00061 unsigned int& startframe, unsigned int& endframe) const;
00062
00070 void getAnimRange(unsigned int lastanim, int lastdir,
00071 bool firststep, int dir,
00072 unsigned int& startframe, unsigned int& endframe) const;
00073
00074 unsigned int getDirCount() const;
00075
00076 enum AnimActionFlags {
00077 AAF_TWOSTEP = 0x0001,
00078 AAF_ATTACK = 0x0002,
00079 AAF_LOOPING = 0x0004,
00080 AAF_UNSTOPPABLE = 0x0008,
00081 AAF_LOOPING2 = 0x0010,
00082 AAF_HANGING = 0x0080,
00083 AAF_CRUS_16DIRS = 0x4000,
00084 AAF_DESTROYACTOR = 0x8000
00085 };
00086 };
00087
00088
00089 #endif