Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-1-2-2013-Decompilation
Path: blob/main/RSDKv4/Animation.hpp
817 views
1
#ifndef ANIMATION_H
2
#define ANIMATION_H
3
4
#define ANIFILE_COUNT (0x100)
5
#define ANIMATION_COUNT (0x400)
6
#define SPRITEFRAME_COUNT (0x1000)
7
8
#define HITBOX_COUNT (0x20)
9
#define HITBOX_DIR_COUNT (0x8)
10
11
enum AnimRotationFlags { ROTSTYLE_NONE, ROTSTYLE_FULL, ROTSTYLE_45DEG, ROTSTYLE_STATICFRAMES };
12
13
struct AnimationFile {
14
char fileName[0x20];
15
int animCount;
16
int aniListOffset;
17
int hitboxListOffset;
18
};
19
20
struct SpriteAnimation {
21
char name[16];
22
byte frameCount;
23
byte speed;
24
byte loopPoint;
25
byte rotationStyle;
26
int frameListOffset;
27
};
28
29
struct SpriteFrame {
30
int sprX;
31
int sprY;
32
int width;
33
int height;
34
int pivotX;
35
int pivotY;
36
byte sheetID;
37
byte hitboxID;
38
};
39
40
struct Hitbox {
41
sbyte left[HITBOX_DIR_COUNT];
42
sbyte top[HITBOX_DIR_COUNT];
43
sbyte right[HITBOX_DIR_COUNT];
44
sbyte bottom[HITBOX_DIR_COUNT];
45
};
46
47
extern AnimationFile animationFileList[ANIFILE_COUNT];
48
extern int animationFileCount;
49
50
extern SpriteFrame scriptFrames[SPRITEFRAME_COUNT];
51
extern int scriptFrameCount;
52
53
extern SpriteFrame animFrames[SPRITEFRAME_COUNT];
54
extern int animFrameCount;
55
extern SpriteAnimation animationList[ANIMATION_COUNT];
56
extern int animationCount;
57
extern Hitbox hitboxList[HITBOX_COUNT];
58
extern int hitboxCount;
59
60
void LoadAnimationFile(char *filePath);
61
void ClearAnimationData();
62
63
AnimationFile *AddAnimationFile(char *filePath);
64
65
inline AnimationFile *GetDefaultAnimationRef() { return &animationFileList[0]; }
66
67
void ProcessObjectAnimation(void *objScr, void *ent);
68
69
#endif // !ANIMATION_H
70
71