summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorAnghelo Carvajal <angheloalf95@gmail.com>2024-04-22 21:34:02 -0400
committerGitHub <noreply@github.com>2024-04-22 18:34:02 -0700
commit76fadbd0e9e041a35b483b10d352e7e738b38b58 (patch)
tree1fed717b91a1671bcf490fc26c5e1b9ec56a6195 /src/code
parent5143cc4d0d97ab0e0fc2b1333b369bedb0994f21 (diff)
`ovl_En_Door` docs pass (#1603)
* DoorScheduleResult * actionVar * DOOR_DL_ * enums * ENDOOR_TYPE_SCHEDULE and related stuff * Name some functions and start figuring out stuff * defines * start documenting schedules * Name Inn doors * More door schedule naming * ajar * Name remaining schedule types * parameters diagram and some cleanups * Name renaiming types * format * rename some schedules * Use more static_assert * name anims * yeet unrelated stuff * requestOpen * Yeet DoorScheduleResult * whoops * stuff i missed * Update src/overlays/actors/ovl_En_Door/scheduleScripts.schl Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/overlays/actors/ovl_En_Door/z_en_door.h Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/overlays/actors/ovl_En_Door/z_en_door.h Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review * Update src/overlays/actors/ovl_En_Pm/z_en_pm.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Update src/code/z_sub_s.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review * FindScheduleDoor --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_actor.c3
-rw-r--r--src/code/z_en_hy_code.c2
-rw-r--r--src/code/z_scene.c2
-rw-r--r--src/code/z_sub_s.c7
-rw-r--r--src/code/z_view.c6
5 files changed, 11 insertions, 9 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c
index 2cf96f760..845215c5e 100644
--- a/src/code/z_actor.c
+++ b/src/code/z_actor.c
@@ -30,6 +30,7 @@ struct Actor* D_801ED920; // 2 funcs. 1 out of z_actor
#include "z64actor.h"
+#include "z64door.h"
#include "z64circle_tex.h"
#include "z64horse.h"
#include "z64malloc.h"
@@ -3428,7 +3429,7 @@ void Actor_SpawnTransitionActors(PlayState* play, ActorContext* actorCtx) {
if (Actor_SpawnAsChildAndCutscene(actorCtx, play, transitionActorList->id & 0x1FFF,
transitionActorList->pos.x, transitionActorList->pos.y,
transitionActorList->pos.z, 0, rotY, 0,
- (i << 0xA) + (transitionActorList->params & 0x3FF),
+ TRANSITION_ACTOR_PARAMS(i, transitionActorList->params),
transitionActorList->rotY & 0x7F, HALFDAYBIT_ALL, 0) != NULL) {
transitionActorList->id = -transitionActorList->id;
}
diff --git a/src/code/z_en_hy_code.c b/src/code/z_en_hy_code.c
index cee1d9466..d1653bb44 100644
--- a/src/code/z_en_hy_code.c
+++ b/src/code/z_en_hy_code.c
@@ -191,7 +191,7 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4
enHy->skelAnime.prevTransl = enHy->skelAnime.jointTable[LIMB_ROOT_POS];
enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1);
AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f);
- door->knobDoor.playOpenAnim = true;
+ door->knobDoor.requestOpen = true;
door->knobDoor.animIndex = animIndex;
}
diff --git a/src/code/z_scene.c b/src/code/z_scene.c
index a7f274a52..acfc182e5 100644
--- a/src/code/z_scene.c
+++ b/src/code/z_scene.c
@@ -108,7 +108,7 @@ s32 Object_GetSlot(ObjectContext* objectCtx, s16 objectId) {
}
}
- return -1;
+ return OBJECT_SLOT_NONE;
}
s32 Object_IsLoaded(ObjectContext* objectCtx, s32 slot) {
diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c
index 7117e1da2..11f97c7d0 100644
--- a/src/code/z_sub_s.c
+++ b/src/code/z_sub_s.c
@@ -15,9 +15,10 @@ Vec3f gOneVec3f = { 1.0f, 1.0f, 1.0f };
s32 D_801C5DBC[] = { 0, 1 }; // Unused
/**
- * Finds the first EnDoor instance with doorType == ENDOOR_TYPE_5 and the specified switchFlag.
+ * Finds the first EnDoor instance of type `ENDOOR_TYPE_SCHEDULE` and the specified schType (a value from the
+ * EnDoorScheduleType enum).
*/
-EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) {
+EnDoor* SubS_FindScheduleDoor(PlayState* play, s32 schType) {
Actor* actor = NULL;
EnDoor* door;
@@ -29,7 +30,7 @@ EnDoor* SubS_FindDoor(PlayState* play, s32 switchFlag) {
break;
}
- if ((door->doorType == ENDOOR_TYPE_5) && (door->switchFlag == (u8)switchFlag)) {
+ if ((door->doorType == ENDOOR_TYPE_SCHEDULE) && (door->typeVar.schType == (u8)schType)) {
break;
}
diff --git a/src/code/z_view.c b/src/code/z_view.c
index 4adc00b8d..56af72134 100644
--- a/src/code/z_view.c
+++ b/src/code/z_view.c
@@ -299,13 +299,13 @@ s32 View_StepDistortion(View* view, Mtx* projectionMtx) {
/**
* Apply view to POLY_OPA_DISP, POLY_XLU_DISP (and OVERLAY_DISP if ortho)
*/
-void View_Apply(View* view, s32 mask) {
+s32 View_Apply(View* view, s32 mask) {
mask = (view->flags & mask) | (mask >> 4);
if (mask & VIEW_PROJECTION_ORTHO) {
- View_ApplyOrtho(view);
+ return View_ApplyOrtho(view);
} else {
- View_ApplyPerspective(view);
+ return View_ApplyPerspective(view);
}
}