Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Graphics/Legacy/AnimationLegacy.hpp
1168 views
1
2
namespace Legacy
3
{
4
5
#define LEGACY_ANIFILE_COUNT (0x100)
6
#define LEGACY_ANIMATION_COUNT (0x400)
7
#define LEGACY_SPRITEFRAME_COUNT (0x1000)
8
9
#define LEGACY_HITBOX_COUNT (0x20)
10
#define LEGACY_HITBOX_DIR_COUNT (0x8)
11
12
enum AnimRotationFlags { ROTSTYLE_NONE, ROTSTYLE_FULL, ROTSTYLE_45DEG, ROTSTYLE_STATICFRAMES };
13
14
struct AnimationFile {
15
char fileName[0x20];
16
int32 animCount;
17
int32 aniListOffset;
18
int32 hitboxListOffset;
19
};
20
21
struct SpriteAnimation {
22
char name[16];
23
uint8 frameCount;
24
uint8 speed;
25
uint8 loopPoint;
26
uint8 rotationStyle;
27
int32 frameListOffset;
28
};
29
30
struct SpriteFrame {
31
int32 sprX;
32
int32 sprY;
33
int32 width;
34
int32 height;
35
int32 pivotX;
36
int32 pivotY;
37
uint8 sheetID;
38
uint8 hitboxID;
39
};
40
41
struct Hitbox {
42
int8 left[LEGACY_HITBOX_DIR_COUNT];
43
int8 top[LEGACY_HITBOX_DIR_COUNT];
44
int8 right[LEGACY_HITBOX_DIR_COUNT];
45
int8 bottom[LEGACY_HITBOX_DIR_COUNT];
46
};
47
48
extern AnimationFile animationFileList[LEGACY_ANIFILE_COUNT];
49
extern int32 animationFileCount;
50
51
extern SpriteFrame scriptFrames[LEGACY_SPRITEFRAME_COUNT];
52
extern int32 scriptFrameCount;
53
54
extern SpriteFrame animFrames[LEGACY_SPRITEFRAME_COUNT];
55
extern int32 animFrameCount;
56
extern SpriteAnimation animationList[LEGACY_ANIMATION_COUNT];
57
extern int32 animationCount;
58
extern Hitbox hitboxList[LEGACY_HITBOX_COUNT];
59
extern int32 hitboxCount;
60
61
void LoadAnimationFile(char *filePath);
62
void ClearAnimationData();
63
64
AnimationFile *AddAnimationFile(char *filePath);
65
66
inline AnimationFile *GetDefaultAnimationRef() { return &animationFileList[0]; }
67
68
namespace v3
69
{
70
void ProcessObjectAnimation(void *objScr, void *ent);
71
}
72
73
namespace v4
74
{
75
void ProcessObjectAnimation(void *objScr, void *ent);
76
}
77
78
} // namespace Legacy
79