Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/Scene/Legacy/v4/ObjectLegacyv4.hpp
1182 views
1
2
namespace Legacy
3
{
4
5
namespace v4
6
{
7
#define LEGACY_v4_ENTITY_COUNT (0x4A0)
8
#define LEGACY_v4_TEMPENTITY_START (LEGACY_v4_ENTITY_COUNT - 0x80)
9
#define LEGACY_v4_OBJECT_COUNT (0x100)
10
#define LEGACY_v4_TYPEGROUP_COUNT (0x103)
11
12
enum ObjectControlModes {
13
CONTROLMODE_NONE = -1,
14
CONTROLMODE_NORMAL = 0,
15
};
16
17
struct TypeGroupList {
18
int32 entityRefs[LEGACY_v4_ENTITY_COUNT];
19
int32 listSize;
20
};
21
22
struct Entity {
23
int32 xpos;
24
int32 ypos;
25
int32 xvel;
26
int32 yvel;
27
int32 speed;
28
int32 values[48];
29
int32 state;
30
int32 angle;
31
int32 scale;
32
int32 rotation;
33
int32 alpha;
34
int32 animationTimer;
35
int32 animationSpeed;
36
int32 lookPosX;
37
int32 lookPosY;
38
uint16 groupID;
39
uint8 type;
40
uint8 propertyValue;
41
uint8 priority;
42
uint8 drawOrder;
43
uint8 direction;
44
uint8 inkEffect;
45
uint8 animation;
46
uint8 prevAnimation;
47
uint8 frame;
48
uint8 collisionMode;
49
uint8 collisionPlane;
50
int8 controlMode;
51
uint8 controlLock;
52
uint8 pushing;
53
uint8 visible;
54
uint8 tileCollisions;
55
uint8 objectInteractions;
56
uint8 gravity;
57
uint8 left;
58
uint8 right;
59
uint8 up;
60
uint8 down;
61
uint8 jumpPress;
62
uint8 jumpHold;
63
uint8 scrollTracking;
64
uint8 floorSensors[5];
65
};
66
67
enum ObjectTypes {
68
OBJ_TYPE_BLANKOBJECT = 0 // 0 is always blank obj
69
};
70
71
enum ObjectGroups {
72
GROUP_ALL = 0 // 0 is always "all"
73
};
74
75
enum ObjectPriority {
76
// The entity is active if the entity is on screen or within 128 pixels of the screen borders on any axis
77
PRIORITY_BOUNDS,
78
// The entity is always active, unless the stage state is PAUSED/FROZEN
79
PRIORITY_ACTIVE,
80
// Same as PRIORITY_ACTIVE, the entity even runs when the stage state is PAUSED/FROZEN
81
PRIORITY_ALWAYS,
82
// Same as PRIORITY_BOUNDS, however it only does checks on the x-axis, so when in bounds on the x-axis, the y position doesn't matter
83
PRIORITY_XBOUNDS,
84
// Same as PRIORITY_XBOUNDS, however the entity's type will be set to BLANK OBJECT when it becomes inactive
85
PRIORITY_XBOUNDS_DESTROY,
86
// Never Active.
87
PRIORITY_INACTIVE,
88
// Same as PRIORITY_BOUNDS, but uses the smaller bounds (32px off screen rather than the normal 128)
89
PRIORITY_BOUNDS_SMALL,
90
// Same as PRIORITY_ACTIVE, but uses the smaller bounds in object.outOfBounds
91
PRIORITY_ACTIVE_SMALL
92
};
93
94
// Game Objects
95
extern int32 objectEntityPos;
96
extern int32 curObjectType;
97
extern Entity objectEntityList[LEGACY_v4_ENTITY_COUNT * 2];
98
extern int32 processObjectFlag[LEGACY_v4_ENTITY_COUNT];
99
extern TypeGroupList objectTypeGroupList[LEGACY_v4_TYPEGROUP_COUNT];
100
101
extern char typeNames[LEGACY_v4_OBJECT_COUNT][0x40];
102
103
extern int32 playerListPos;
104
105
void ProcessStartupObjects();
106
void ProcessObjects();
107
void ProcessPausedObjects();
108
void ProcessFrozenObjects();
109
void Process2PObjects();
110
111
void SetObjectTypeName(const char *objectName, int32 objectID);
112
113
void ProcessObjectControl(Entity *player);
114
} // namespace v4
115
116
} // namespace Legacy
117