Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Cutscene/CutsceneSeq.h
338 views
1
#ifndef OBJ_CUTSCENESEQ_H
2
#define OBJ_CUTSCENESEQ_H
3
4
#include "Game.h"
5
6
#define CUTSCENESEQ_POINT_COUNT (8)
7
8
#if MANIA_USE_PLUS
9
typedef enum {
10
SKIPTYPE_DISABLED,
11
SKIPTYPE_RELOADSCN,
12
SKIPTYPE_NEXTSCENE,
13
SKIPTYPE_CALLBACK,
14
} SkipTypes;
15
#endif
16
17
// Object Class
18
struct ObjectCutsceneSeq {
19
RSDK_OBJECT
20
};
21
22
// Entity Class
23
struct EntityCutsceneSeq {
24
RSDK_ENTITY
25
bool32 (*currentState)(EntityCutsceneSeq *host);
26
uint8 stateID;
27
int32 timer;
28
int32 storedValue; // never reset, unlike timer & the 8 values
29
int32 storedTimer;
30
int32 values[8];
31
Entity *activeEntity; // the entity that called StartSequence
32
Entity *managerEntity; // the host entity of the sequence
33
bool32 (*cutsceneStates[0x40])(EntityCutsceneSeq *host);
34
Vector2 points[CUTSCENESEQ_POINT_COUNT];
35
int32 fadeWhite;
36
int32 fadeBlack;
37
#if MANIA_USE_PLUS
38
int32 skipType;
39
void (*skipCallback)(void);
40
#endif
41
};
42
43
// Object Struct
44
extern ObjectCutsceneSeq *CutsceneSeq;
45
46
// Standard Entity Events
47
void CutsceneSeq_Update(void);
48
void CutsceneSeq_LateUpdate(void);
49
void CutsceneSeq_StaticUpdate(void);
50
void CutsceneSeq_Draw(void);
51
void CutsceneSeq_Create(void *data);
52
void CutsceneSeq_StageLoad(void);
53
#if GAME_INCLUDE_EDITOR
54
void CutsceneSeq_EditorDraw(void);
55
void CutsceneSeq_EditorLoad(void);
56
#endif
57
void CutsceneSeq_Serialize(void);
58
59
// Extra Entity Functions
60
// Initializes a new state with ID of `nextState`
61
void CutsceneSeq_NewState(int32 nextState, EntityCutsceneSeq *seq);
62
#if MANIA_USE_PLUS
63
// Sets the cutscene's skip type (non-callback)
64
void CutsceneSeq_SetSkipType(uint8 type);
65
// Sets the cutscene's skip type to SKIPTYPE_CALLBACK and set the callback function
66
void CutsceneSeq_SetSkipTypeCallback(void (*callback)(void));
67
// Checks if the cutscene was skipped
68
void CutsceneSeq_CheckSkip(uint8 skipType, EntityCutsceneSeq *seq, void (*skipCallback)(void));
69
#endif
70
// Does a foreach loop for the entity of type `type`
71
Entity *CutsceneSeq_GetEntity(int32 type);
72
// Locks control of the selected player
73
void CutsceneSeq_LockPlayerControl(EntityPlayer *player);
74
// Locks Control of all players
75
void CutsceneSeq_LockAllPlayerControl(void);
76
// Sets up a cutscene sequence, the cutscene object should be passed as 'manager', then the cutscene states should be passed in order, make sure to
77
// end the states with StateMachine_None to tell it when to stop reading states
78
void CutsceneSeq_StartSequence(void *manager, ...);
79
80
#endif //! OBJ_CUTSCENESEQ_H
81
82