-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathAnimation.hpp
69 lines (54 loc) · 1.54 KB
/
Animation.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef ANIMATION_H
#define ANIMATION_H
#define ANIFILE_COUNT (0x100)
#define ANIMATION_COUNT (0x400)
#define SPRITEFRAME_COUNT (0x1000)
#define HITBOX_COUNT (0x20)
#define HITBOX_DIR_COUNT (0x8)
enum AnimrotationFlags { ROTSTYLE_NONE, ROTSTYLE_FULL, ROTSTYLE_45DEG, ROTSTYLE_STATICFRAMES };
struct AnimationFile {
char fileName[0x20];
int animCount;
int aniListOffset;
int hitboxListOffset;
};
struct SpriteAnimation {
char name[16];
byte frameCount;
byte speed;
byte loopPoint;
byte rotationStyle;
int frameListOffset;
};
struct SpriteFrame {
int sprX;
int sprY;
int width;
int height;
int pivotX;
int pivotY;
byte sheetID;
byte hitboxID;
};
struct Hitbox {
sbyte left[HITBOX_DIR_COUNT];
sbyte top[HITBOX_DIR_COUNT];
sbyte right[HITBOX_DIR_COUNT];
sbyte bottom[HITBOX_DIR_COUNT];
};
extern AnimationFile animationFileList[ANIFILE_COUNT];
extern int animationFileCount;
extern SpriteFrame scriptFrames[SPRITEFRAME_COUNT];
extern int scriptFrameCount;
extern SpriteFrame animFrames[SPRITEFRAME_COUNT];
extern int animFrameCount;
extern SpriteAnimation animationList[ANIMATION_COUNT];
extern int animationCount;
extern Hitbox hitboxList[HITBOX_COUNT];
extern int hitboxCount;
void LoadAnimationFile(const char *FilePath);
void ClearAnimationData();
AnimationFile *AddAnimationFile(const char *FilePath);
inline AnimationFile *GetDefaultAnimationRef() { return &animationFileList[0]; }
void ProcessObjectAnimation(void *objScr, void *ent);
#endif // !ANIMATION_H