Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/CPZ/TransportTube.h
338 views
1
#ifndef OBJ_TRANSPORTTUBE_H
2
#define OBJ_TRANSPORTTUBE_H
3
4
#include "Game.h"
5
6
typedef enum {
7
TRANSPORTTUBE_CHANGEDIR,
8
TRANSPORTTUBE_ENTRY,
9
TRANSPORTTUBE_TOTARGET_NEXT,
10
TRANSPORTTUBE_TOTARGET_PREV,
11
TRANSPORTTUBE_TOTARGET_NODE,
12
TRANSPORTTUBE_JUNCTION,
13
TRANSPORTTUBE_EXIT,
14
} TransportTubeTypes;
15
16
typedef enum {
17
TRANSPORTTUBE_DIR_NONE = 0,
18
TRANSPORTTUBE_DIR_N = 1 << 0,
19
TRANSPORTTUBE_DIR_S = 1 << 1,
20
TRANSPORTTUBE_DIR_W = 1 << 2,
21
TRANSPORTTUBE_DIR_E = 1 << 3,
22
TRANSPORTTUBE_DIR_NE = 1 << 4,
23
TRANSPORTTUBE_DIR_NW = 1 << 5,
24
TRANSPORTTUBE_DIR_SE = 1 << 6,
25
TRANSPORTTUBE_DIR_SW = 1 << 7,
26
} TransportTubeDirMasks;
27
28
// Object Class
29
struct ObjectTransportTube {
30
RSDK_OBJECT
31
int32 nextSlot[4];
32
uint16 aniFrames;
33
uint16 sfxTravel;
34
};
35
36
// Entity Class
37
struct EntityTransportTube {
38
RSDK_ENTITY
39
StateMachine(state);
40
uint8 type;
41
uint8 dirMask;
42
int32 directionCount;
43
Vector2 dirVelocity[8];
44
int32 directionIDs[8];
45
int32 playerTimers[PLAYER_COUNT];
46
EntityPlayer *players[PLAYER_COUNT];
47
Animator animator;
48
};
49
50
// Object Struct
51
extern ObjectTransportTube *TransportTube;
52
53
// Standard Entity Events
54
void TransportTube_Update(void);
55
void TransportTube_LateUpdate(void);
56
void TransportTube_StaticUpdate(void);
57
void TransportTube_Draw(void);
58
void TransportTube_Create(void *data);
59
void TransportTube_StageLoad(void);
60
#if GAME_INCLUDE_EDITOR
61
void TransportTube_EditorDraw(void);
62
void TransportTube_EditorLoad(void);
63
#endif
64
void TransportTube_Serialize(void);
65
66
// Extra Entity Functions
67
void TransportTube_SetupDirections(EntityTransportTube *entity);
68
void TransportTube_HandleVelocityChange(int32 velX, int32 velY);
69
70
void TransportTube_State_ChangeDir(void);
71
void TransportTube_State_Entry(void);
72
void TransportTube_State_ToTargetEntity(void);
73
void TransportTube_State_TargetSeqNode(void);
74
void TransportTube_State_ChooseDir(void);
75
void TransportTube_State_Exit(void);
76
77
#endif //! OBJ_TRANSPORTTUBE_H
78
79