mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00: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:
parent
4f0018bf36
commit
154f44b6da
14 changed files with 144 additions and 124 deletions
|
@ -53,7 +53,7 @@ void func_80095AB4(GlobalContext* globalCtx, Room* room, u32 flags) {
|
|||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
polygon0 = &room->mesh->polygon0;
|
||||
polygon0 = &room->meshHeader->polygon0;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon0->start);
|
||||
for (i = 0; i < polygon0->num; i++) {
|
||||
if ((flags & 1) && (polygonDlist->opa != NULL)) {
|
||||
|
@ -114,7 +114,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) {
|
|||
gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
}
|
||||
|
||||
polygon2 = &room->mesh->polygon2;
|
||||
polygon2 = &room->meshHeader->polygon2;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon2->start);
|
||||
spA4 = spB8;
|
||||
|
||||
|
@ -320,7 +320,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
|||
|
||||
activeCam = GET_ACTIVE_CAM(globalCtx);
|
||||
isFixedCamera = (activeCam->setting == CAM_SET_PREREND_FIXED);
|
||||
polygon1 = &room->mesh->polygon1;
|
||||
polygon1 = &room->meshHeader->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
drawBg = (flags & 1) && isFixedCamera && polygon1->single.source && !(SREG(25) & 1);
|
||||
drawOpa = (flags & 1) && (polygonDlist->opa != NULL) && !(SREG(25) & 2);
|
||||
|
@ -412,7 +412,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
|||
|
||||
activeCam = GET_ACTIVE_CAM(globalCtx);
|
||||
isFixedCamera = (activeCam->setting == CAM_SET_PREREND_FIXED);
|
||||
polygon1 = &room->mesh->polygon1;
|
||||
polygon1 = &room->meshHeader->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
bgImage = func_80096A74(polygon1, globalCtx);
|
||||
drawBg = (flags & 1) && isFixedCamera && bgImage->source && !(SREG(25) & 1);
|
||||
|
@ -459,7 +459,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
|||
|
||||
// Room Draw Polygon Type 1
|
||||
void func_80096F6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
PolygonType1* polygon1 = &room->mesh->polygon1;
|
||||
PolygonType1* polygon1 = &room->meshHeader->polygon1;
|
||||
|
||||
if (polygon1->format == 1) {
|
||||
func_80096680(globalCtx, room, flags);
|
||||
|
@ -585,9 +585,9 @@ s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
|||
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
if (room->segment != NULL) {
|
||||
gSegments[3] = VIRTUAL_TO_PHYSICAL(room->segment);
|
||||
ASSERT(room->mesh->polygon.type < ARRAY_COUNTU(sRoomDrawHandlers),
|
||||
ASSERT(room->meshHeader->base.type < ARRAY_COUNTU(sRoomDrawHandlers),
|
||||
"this->ground_shape->polygon.type < number(Room_Draw_Proc)", "../z_room.c", 1125);
|
||||
sRoomDrawHandlers[room->mesh->polygon.type](globalCtx, room, flags);
|
||||
sRoomDrawHandlers[room->meshHeader->base.type](globalCtx, room, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue