Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Global/Debris.h
338 views
1
#ifndef OBJ_DEBRIS_H
2
#define OBJ_DEBRIS_H
3
4
#include "Game.h"
5
6
// Structs
7
typedef struct {
8
int32 frame;
9
int32 direction;
10
Vector2 velocity;
11
} DebrisEntry;
12
13
typedef struct {
14
int32 frame;
15
int32 direction;
16
Vector2 velocity;
17
Vector2 offset;
18
} DebrisOffsetEntry;
19
20
// Object Class
21
struct ObjectDebris {
22
RSDK_OBJECT
23
};
24
25
// Entity Class
26
struct EntityDebris {
27
RSDK_ENTITY
28
StateMachine(state);
29
int32 timer;
30
int32 gravityStrength;
31
int32 rotSpeed;
32
Vector2 scaleSpeed;
33
int32 delay;
34
Animator animator;
35
};
36
37
// Object Struct
38
extern ObjectDebris *Debris;
39
40
// Standard Entity Events
41
void Debris_Update(void);
42
void Debris_LateUpdate(void);
43
void Debris_StaticUpdate(void);
44
void Debris_Draw(void);
45
void Debris_Create(void *data);
46
void Debris_StageLoad(void);
47
#if GAME_INCLUDE_EDITOR
48
void Debris_EditorDraw(void);
49
void Debris_EditorLoad(void);
50
#endif
51
void Debris_Serialize(void);
52
53
// Extra Entity Functions
54
55
// 'entries' format: int32 count, [count] entries of type DebrisEntry
56
void Debris_CreateFromEntries(int32 aniFrames, int32 *entries, int32 animationID);
57
// 'entries' format: int32 count, [count] entries of type DebrisOffsetEntry
58
void Debris_CreateFromEntries_UseOffset(int32 aniFrames, int32 *entries);
59
60
void Debris_State_Move(void);
61
void Debris_State_Fall(void);
62
void Debris_State_FallAndFlicker(void);
63
64
#endif //! OBJ_DEBRIS_H
65
66