/
object_list_processor.h
126 lines (104 loc) · 4.41 KB
/
object_list_processor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#ifndef OBJECT_LIST_PROCESSOR_H
#define OBJECT_LIST_PROCESSOR_H
#include <PR/ultratypes.h>
#include "area.h"
#include "macros.h"
#include "types.h"
/**
* Flags for gTimeStopState. These control which objects are processed each frame
* and also track some miscellaneous info.
*/
#define TIME_STOP_UNKNOWN_0 (1 << 0)
#define TIME_STOP_ENABLED (1 << 1)
#define TIME_STOP_DIALOG (1 << 2)
#define TIME_STOP_MARIO_AND_DOORS (1 << 3)
#define TIME_STOP_ALL_OBJECTS (1 << 4)
#define TIME_STOP_MARIO_OPENED_DOOR (1 << 5)
#define TIME_STOP_ACTIVE (1 << 6)
/**
* The maximum number of objects that can be loaded at once.
*/
#define OBJECT_POOL_CAPACITY 240
/**
* Every object is categorized into an object list, which controls the order
* they are processed and which objects they can collide with.
*/
enum ObjectList {
OBJ_LIST_PLAYER, // (0) Mario
OBJ_LIST_UNUSED_1, // (1) (unused)
OBJ_LIST_DESTRUCTIVE, // (2) things that can be used to destroy other objects, like
// bob-ombs and corkboxes
OBJ_LIST_UNUSED_3, // (3) (unused)
OBJ_LIST_GENACTOR, // (4) general actors. most normal 'enemies' or actors are
// on this list. (MIPS, bullet bill, bully, etc)
OBJ_LIST_PUSHABLE, // (5) pushable actors. This is a group of objects which
// can push each other around as well as their parent
// objects. (goombas, koopas, spinies)
OBJ_LIST_LEVEL, // (6) level objects. general level objects such as heart, star
OBJ_LIST_UNUSED_7, // (7) (unused)
OBJ_LIST_DEFAULT, // (8) default objects. objects that didnt start with a 00
// command are put here, so this is treated as a default.
OBJ_LIST_SURFACE, // (9) surface objects. objects that specifically have surface
// collision and not object collision. (thwomp, whomp, etc)
OBJ_LIST_POLELIKE, // (10) polelike objects. objects that attract or otherwise
// "cling" Mario similar to a pole action. (hoot,
// whirlpool, trees/poles, etc)
OBJ_LIST_SPAWNER, // (11) spawners
OBJ_LIST_UNIMPORTANT, // (12) unimportant objects. objects that will not load
// if there are not enough object slots: they will also
// be manually unloaded to make room for slots if the list
// gets exhausted.
NUM_OBJ_LISTS
};
extern struct ObjectNode gObjectListArray[];
extern s32 gDebugInfoFlags;
extern s32 gNumFindFloorMisses;
extern UNUSED s32 unused_8033BEF8;
extern s32 gUnknownWallCount;
extern u32 gObjectCounter;
struct NumTimesCalled {
/*0x00*/ s16 floor;
/*0x02*/ s16 ceil;
/*0x04*/ s16 wall;
};
extern struct NumTimesCalled gNumCalls;
extern s16 gDebugInfo[][8];
extern s16 gDebugInfoOverwrite[][8];
extern u32 gTimeStopState;
extern struct Object gObjectPool[];
extern struct Object gMacroObjectDefaultParent;
extern struct ObjectNode *gObjectLists;
extern struct ObjectNode gFreeObjectList;
extern struct Object *gMarioObject;
extern struct Object *gLuigiObject;
extern struct Object *gCurrentObject;
extern const BehaviorScript *gCurBhvCommand;
extern s16 gPrevFrameObjectCount;
extern s32 gSurfaceNodesAllocated;
extern s32 gSurfacesAllocated;
extern s32 gNumStaticSurfaceNodes;
extern s32 gNumStaticSurfaces;
extern struct MemoryPool *gObjectMemoryPool;
extern s16 gCheckingSurfaceCollisionsForCamera;
extern s16 gFindFloorIncludeSurfaceIntangible;
extern TerrainData *gEnvironmentRegions;
extern s32 gEnvironmentLevels[20];
extern RoomData gDoorAdjacentRooms[60][2];
extern s16 gMarioCurrentRoom;
extern s16 D_8035FEE2;
extern s16 D_8035FEE4;
extern s16 gTHIWaterDrained;
extern s16 gTTCSpeedSetting;
extern s16 gMarioShotFromCannon;
extern s16 gCCMEnteredSlide;
extern s16 gNumRoomedObjectsInMarioRoom;
extern s16 gNumRoomedObjectsNotInMarioRoom;
extern s16 gWDWWaterLevelChanging;
extern s16 gMarioOnMerryGoRound;
void bhv_mario_update(void);
void set_object_respawn_info_bits(struct Object *obj, u8 bits);
void unload_objects_from_area(UNUSED s32 unused, s32 areaIndex);
void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo);
void clear_objects(void);
void update_objects(UNUSED s32 unused);
#endif // OBJECT_LIST_PROCESSOR_H