mirror of
https://github.com/zeldaret/oot
synced 2026-07-09 06:43:38 -04:00
Documentation pass on scene/room commands (#1226)
* Rename handler functions
* Rename cmd_id enum names for consistency
* `char` -> `s8` for explicit padding in cmd structs
* `Room.unk03/03` -> `behaviorType2/1`
* `UNK_PTR` -> `void*`
* `showInvisActors` -> `lensActorsMode` + enum
* Add `ROOM_BEHAVIOR_TYPE1/2_` enums
* "mesh" -> "mesh header"
* `Polygon polygon` -> `PolygonBase base` (for now...)
* Misc cleanup
* "lens actors mode" -> "lens actor mode"
* Revert "`char` -> `s8` for explicit padding in cmd structs"
This reverts commit 59b9295828.
* `LENS_ACTOR_MODE_` -> `LENS_MODE_HIDE/SHOW_ACTORS`
This commit is contained in:
+35
-14
@@ -796,13 +796,10 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x01 */ u8 num; // number of dlist entries
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ void* end;
|
||||
} Polygon; // size = 0xC
|
||||
} PolygonBase;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x00 */ PolygonBase base;
|
||||
/* 0x01 */ u8 num; // number of dlist entries
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ void* end;
|
||||
@@ -823,7 +820,7 @@ typedef struct {
|
||||
} BgImage; // size = 0x1C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x00 */ PolygonBase base;
|
||||
/* 0x01 */ u8 format; // 1 = single, 2 = multi
|
||||
/* 0x04 */ Gfx* dlist;
|
||||
union {
|
||||
@@ -853,27 +850,51 @@ typedef struct {
|
||||
} PolygonDlist2; // size = 0x8
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x00 */ PolygonBase base;
|
||||
/* 0x01 */ u8 num; // number of dlist entries
|
||||
/* 0x04 */ void* start;
|
||||
/* 0x08 */ void* end;
|
||||
} PolygonType2; // size = 0xC
|
||||
|
||||
typedef union {
|
||||
Polygon polygon;
|
||||
PolygonBase base;
|
||||
PolygonType0 polygon0;
|
||||
PolygonType1 polygon1;
|
||||
PolygonType2 polygon2;
|
||||
} Mesh; // "Ground Shape"
|
||||
} MeshHeader; // "Ground Shape"
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ LENS_MODE_HIDE_ACTORS, // lens actors are visible by default, and hidden by using lens (for example, fake walls)
|
||||
/* 1 */ LENS_MODE_SHOW_ACTORS // lens actors are invisible by default, and shown by using lens (for example, invisible enemies)
|
||||
} LensMode;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ROOM_BEHAVIOR_TYPE1_0,
|
||||
/* 1 */ ROOM_BEHAVIOR_TYPE1_1,
|
||||
/* 2 */ ROOM_BEHAVIOR_TYPE1_2,
|
||||
/* 3 */ ROOM_BEHAVIOR_TYPE1_3, // unused
|
||||
/* 4 */ ROOM_BEHAVIOR_TYPE1_4, // unused
|
||||
/* 5 */ ROOM_BEHAVIOR_TYPE1_5
|
||||
} RoomBehaviorType1;
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ROOM_BEHAVIOR_TYPE2_0,
|
||||
/* 1 */ ROOM_BEHAVIOR_TYPE2_1,
|
||||
/* 2 */ ROOM_BEHAVIOR_TYPE2_2,
|
||||
/* 3 */ ROOM_BEHAVIOR_TYPE2_3,
|
||||
/* 4 */ ROOM_BEHAVIOR_TYPE2_4,
|
||||
/* 5 */ ROOM_BEHAVIOR_TYPE2_5,
|
||||
/* 6 */ ROOM_BEHAVIOR_TYPE2_6
|
||||
} RoomBehaviorType2;
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ s8 num;
|
||||
/* 0x01 */ u8 unk_01;
|
||||
/* 0x02 */ u8 unk_02;
|
||||
/* 0x03 */ u8 unk_03;
|
||||
/* 0x02 */ u8 behaviorType2;
|
||||
/* 0x03 */ u8 behaviorType1;
|
||||
/* 0x04 */ s8 echo;
|
||||
/* 0x05 */ u8 showInvisActors;
|
||||
/* 0x08 */ Mesh* mesh; // original name: "ground_shape"
|
||||
/* 0x05 */ u8 lensMode;
|
||||
/* 0x08 */ MeshHeader* meshHeader; // original name: "ground_shape"
|
||||
/* 0x0C */ void* segment;
|
||||
/* 0x10 */ char unk_10[0x4];
|
||||
} Room; // size = 0x14
|
||||
@@ -1208,7 +1229,7 @@ typedef struct GlobalContext {
|
||||
/* 0x11DF0 */ RomFile* roomList;
|
||||
/* 0x11DF4 */ ActorEntry* linkActorEntry;
|
||||
/* 0x11DF8 */ ActorEntry* setupActorList;
|
||||
/* 0x11DFC */ UNK_PTR unk_11DFC;
|
||||
/* 0x11DFC */ void* unk_11DFC;
|
||||
/* 0x11E00 */ EntranceEntry* setupEntranceList;
|
||||
/* 0x11E04 */ s16* setupExitList;
|
||||
/* 0x11E08 */ Path* setupPathList;
|
||||
|
||||
+12
-12
@@ -343,20 +343,20 @@ typedef enum {
|
||||
typedef enum {
|
||||
/* 0x00 */ SCENE_CMD_ID_SPAWN_LIST,
|
||||
/* 0x01 */ SCENE_CMD_ID_ACTOR_LIST,
|
||||
/* 0x02 */ SCENE_CMD_ID_UNUSED_02,
|
||||
/* 0x03 */ SCENE_CMD_ID_COL_HEADER,
|
||||
/* 0x02 */ SCENE_CMD_ID_UNUSED_2,
|
||||
/* 0x03 */ SCENE_CMD_ID_COLLISION_HEADER,
|
||||
/* 0x04 */ SCENE_CMD_ID_ROOM_LIST,
|
||||
/* 0x05 */ SCENE_CMD_ID_WIND_SETTINGS,
|
||||
/* 0x06 */ SCENE_CMD_ID_ENTRANCE_LIST,
|
||||
/* 0x07 */ SCENE_CMD_ID_SPECIAL_FILES,
|
||||
/* 0x08 */ SCENE_CMD_ID_ROOM_BEHAVIOR,
|
||||
/* 0x09 */ SCENE_CMD_ID_UNK_09,
|
||||
/* 0x0A */ SCENE_CMD_ID_MESH,
|
||||
/* 0x09 */ SCENE_CMD_ID_UNDEFINED_9,
|
||||
/* 0x0A */ SCENE_CMD_ID_MESH_HEADER,
|
||||
/* 0x0B */ SCENE_CMD_ID_OBJECT_LIST,
|
||||
/* 0x0C */ SCENE_CMD_ID_LIGHT_LIST,
|
||||
/* 0x0D */ SCENE_CMD_ID_PATH_LIST,
|
||||
/* 0x0E */ SCENE_CMD_ID_TRANSI_ACTOR_LIST,
|
||||
/* 0x0F */ SCENE_CMD_ID_ENV_LIGHT_SETTINGS,
|
||||
/* 0x0E */ SCENE_CMD_ID_TRANSITION_ACTOR_LIST,
|
||||
/* 0x0F */ SCENE_CMD_ID_LIGHT_SETTINGS_LIST,
|
||||
/* 0x10 */ SCENE_CMD_ID_TIME_SETTINGS,
|
||||
/* 0x11 */ SCENE_CMD_ID_SKYBOX_SETTINGS,
|
||||
/* 0x12 */ SCENE_CMD_ID_SKYBOX_DISABLES,
|
||||
@@ -377,10 +377,10 @@ typedef enum {
|
||||
{ SCENE_CMD_ID_ACTOR_LIST, numActors, CMD_PTR(actorList) }
|
||||
|
||||
#define SCENE_CMD_UNUSED_02(unk, data) \
|
||||
{ SCENE_CMD_ID_UNUSED_02, unk, CMD_PTR(data) }
|
||||
{ SCENE_CMD_ID_UNUSED_2, unk, CMD_PTR(data) }
|
||||
|
||||
#define SCENE_CMD_COL_HEADER(colHeader) \
|
||||
{ SCENE_CMD_ID_COL_HEADER, 0, CMD_PTR(colHeader) }
|
||||
{ SCENE_CMD_ID_COLLISION_HEADER, 0, CMD_PTR(colHeader) }
|
||||
|
||||
#define SCENE_CMD_ROOM_LIST(numRooms, roomList) \
|
||||
{ SCENE_CMD_ID_ROOM_LIST, numRooms, CMD_PTR(roomList) }
|
||||
@@ -399,10 +399,10 @@ typedef enum {
|
||||
curRoomUnk2 | _SHIFTL(showInvisActors, 8, 1) | _SHIFTL(disableWarpSongs, 10, 1) }
|
||||
|
||||
#define SCENE_CMD_UNK_09() \
|
||||
{ SCENE_CMD_ID_UNK_09, 0, CMD_W(0) }
|
||||
{ SCENE_CMD_ID_UNDEFINED_9, 0, CMD_W(0) }
|
||||
|
||||
#define SCENE_CMD_MESH(meshHeader) \
|
||||
{ SCENE_CMD_ID_MESH, 0, CMD_PTR(meshHeader) }
|
||||
{ SCENE_CMD_ID_MESH_HEADER, 0, CMD_PTR(meshHeader) }
|
||||
|
||||
#define SCENE_CMD_OBJECT_LIST(numObjects, objectList) \
|
||||
{ SCENE_CMD_ID_OBJECT_LIST, numObjects, CMD_PTR(objectList) }
|
||||
@@ -414,10 +414,10 @@ typedef enum {
|
||||
{ SCENE_CMD_ID_PATH_LIST, 0, CMD_PTR(pathList) }
|
||||
|
||||
#define SCENE_CMD_TRANSITION_ACTOR_LIST(numActors, list) \
|
||||
{ SCENE_CMD_ID_TRANSI_ACTOR_LIST, numActors, CMD_PTR(list) }
|
||||
{ SCENE_CMD_ID_TRANSITION_ACTOR_LIST, numActors, CMD_PTR(list) }
|
||||
|
||||
#define SCENE_CMD_ENV_LIGHT_SETTINGS(numLightSettings, lightSettingsList) \
|
||||
{ SCENE_CMD_ID_ENV_LIGHT_SETTINGS, numLightSettings, CMD_PTR(lightSettingsList) }
|
||||
{ SCENE_CMD_ID_LIGHT_SETTINGS_LIST, numLightSettings, CMD_PTR(lightSettingsList) }
|
||||
|
||||
#define SCENE_CMD_TIME_SETTINGS(hour, min, speed) \
|
||||
{ SCENE_CMD_ID_TIME_SETTINGS, 0, CMD_BBBB(hour, min, speed, 0) }
|
||||
|
||||
Reference in New Issue
Block a user