Path: blob/master/SonicMania/Objects/Cutscene/CutsceneSeq.h
338 views
#ifndef OBJ_CUTSCENESEQ_H1#define OBJ_CUTSCENESEQ_H23#include "Game.h"45#define CUTSCENESEQ_POINT_COUNT (8)67#if MANIA_USE_PLUS8typedef enum {9SKIPTYPE_DISABLED,10SKIPTYPE_RELOADSCN,11SKIPTYPE_NEXTSCENE,12SKIPTYPE_CALLBACK,13} SkipTypes;14#endif1516// Object Class17struct ObjectCutsceneSeq {18RSDK_OBJECT19};2021// Entity Class22struct EntityCutsceneSeq {23RSDK_ENTITY24bool32 (*currentState)(EntityCutsceneSeq *host);25uint8 stateID;26int32 timer;27int32 storedValue; // never reset, unlike timer & the 8 values28int32 storedTimer;29int32 values[8];30Entity *activeEntity; // the entity that called StartSequence31Entity *managerEntity; // the host entity of the sequence32bool32 (*cutsceneStates[0x40])(EntityCutsceneSeq *host);33Vector2 points[CUTSCENESEQ_POINT_COUNT];34int32 fadeWhite;35int32 fadeBlack;36#if MANIA_USE_PLUS37int32 skipType;38void (*skipCallback)(void);39#endif40};4142// Object Struct43extern ObjectCutsceneSeq *CutsceneSeq;4445// Standard Entity Events46void CutsceneSeq_Update(void);47void CutsceneSeq_LateUpdate(void);48void CutsceneSeq_StaticUpdate(void);49void CutsceneSeq_Draw(void);50void CutsceneSeq_Create(void *data);51void CutsceneSeq_StageLoad(void);52#if GAME_INCLUDE_EDITOR53void CutsceneSeq_EditorDraw(void);54void CutsceneSeq_EditorLoad(void);55#endif56void CutsceneSeq_Serialize(void);5758// Extra Entity Functions59// Initializes a new state with ID of `nextState`60void CutsceneSeq_NewState(int32 nextState, EntityCutsceneSeq *seq);61#if MANIA_USE_PLUS62// Sets the cutscene's skip type (non-callback)63void CutsceneSeq_SetSkipType(uint8 type);64// Sets the cutscene's skip type to SKIPTYPE_CALLBACK and set the callback function65void CutsceneSeq_SetSkipTypeCallback(void (*callback)(void));66// Checks if the cutscene was skipped67void CutsceneSeq_CheckSkip(uint8 skipType, EntityCutsceneSeq *seq, void (*skipCallback)(void));68#endif69// Does a foreach loop for the entity of type `type`70Entity *CutsceneSeq_GetEntity(int32 type);71// Locks control of the selected player72void CutsceneSeq_LockPlayerControl(EntityPlayer *player);73// Locks Control of all players74void CutsceneSeq_LockAllPlayerControl(void);75// Sets up a cutscene sequence, the cutscene object should be passed as 'manager', then the cutscene states should be passed in order, make sure to76// end the states with StateMachine_None to tell it when to stop reading states77void CutsceneSeq_StartSequence(void *manager, ...);7879#endif //! OBJ_CUTSCENESEQ_H808182