From 39e4e63b4d896f383946d4bcfe9ecea8ed5ec175 Mon Sep 17 00:00:00 2001 From: blackgamma7 Date: Sat, 19 Nov 2022 10:30:56 -0500 Subject: [PATCH] `z_obj_lift`: doc remaining funcs and field (#1440) * `z_obj_lift`: doc funcs and field doc remaining funcs and field in `z_obj_lift` * `z_obj_lift`: shakeVec->shakeOrientation * removed space from copy-paste of field name --- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 64 +++++++++---------- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index ebde3975cc..31e25425c6 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -16,13 +16,13 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play); void ObjLift_Update(Actor* thisx, PlayState* play); void ObjLift_Draw(Actor* thisx, PlayState* play); -void func_80B9651C(ObjLift* this); -void func_80B9664C(ObjLift* this); -void func_80B967C0(ObjLift* this); +void ObjLift_SetupWait(ObjLift* this); +void ObjLift_SetupShake(ObjLift* this); +void ObjLift_SetupFall(ObjLift* this); -void func_80B96560(ObjLift* this, PlayState* play); -void func_80B96678(ObjLift* this, PlayState* play); -void func_80B96840(ObjLift* this, PlayState* play); +void ObjLift_Wait(ObjLift* this, PlayState* play); +void ObjLift_Shake(ObjLift* this, PlayState* play); +void ObjLift_Fall(ObjLift* this, PlayState* play); ActorInit Obj_Lift_InitVars = { ACTOR_OBJ_LIFT, @@ -76,7 +76,7 @@ void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* colli } } -void func_80B96160(ObjLift* this, PlayState* play) { +void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) { Vec3f pos; Vec3f velocity; Vec3f* temp_s3; @@ -116,10 +116,10 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->dyna.actor, sScales[(this->dyna.actor.params >> 1) & 1]); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->unk_168.x = Rand_ZeroOne() * 65535.5f; - this->unk_168.y = Rand_ZeroOne() * 65535.5f; - this->unk_168.z = Rand_ZeroOne() * 65535.5f; - func_80B9651C(this); + this->shakeOrientation.x = Rand_ZeroOne() * 65535.5f; + this->shakeOrientation.y = Rand_ZeroOne() * 65535.5f; + this->shakeOrientation.z = Rand_ZeroOne() * 65535.5f; + ObjLift_SetupWait(this); osSyncPrintf("(Dungeon Lift)(arg_data 0x%04x)\n", this->dyna.actor.params); } @@ -129,25 +129,25 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } -void func_80B9651C(ObjLift* this) { +void ObjLift_SetupWait(ObjLift* this) { this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7]; - ObjLift_SetupAction(this, func_80B96560); + ObjLift_SetupAction(this, ObjLift_Wait); } -void func_80B96560(ObjLift* this, PlayState* play) { +void ObjLift_Wait(ObjLift* this, PlayState* play) { s32 pad; s32 quakeIndex; if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->timer <= 0) { if (((this->dyna.actor.params >> 8) & 7) == 7) { - func_80B967C0(this); + ObjLift_SetupFall(this); } else { quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1); Quake_SetSpeed(quakeIndex, 10000); Quake_SetPerturbations(quakeIndex, 2, 0, 0, 0); Quake_SetDuration(quakeIndex, 20); - func_80B9664C(this); + ObjLift_SetupShake(this); } } } else { @@ -155,25 +155,25 @@ void func_80B96560(ObjLift* this, PlayState* play) { } } -void func_80B9664C(ObjLift* this) { +void ObjLift_SetupShake(ObjLift* this) { this->timer = 20; - ObjLift_SetupAction(this, func_80B96678); + ObjLift_SetupAction(this, ObjLift_Shake); } -void func_80B96678(ObjLift* this, PlayState* play) { +void ObjLift_Shake(ObjLift* this, PlayState* play) { if (this->timer <= 0) { - func_80B967C0(this); + ObjLift_SetupFall(this); } else { - this->unk_168.x += 10000; - this->dyna.actor.world.rot.x = (s16)(Math_SinS(this->unk_168.x) * 300.0f) + this->dyna.actor.home.rot.x; - this->dyna.actor.world.rot.z = (s16)(Math_CosS(this->unk_168.x) * 300.0f) + this->dyna.actor.home.rot.z; + this->shakeOrientation.x += 10000; + this->dyna.actor.world.rot.x = (s16)(Math_SinS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.x; + this->dyna.actor.world.rot.z = (s16)(Math_CosS(this->shakeOrientation.x) * 300.0f) + this->dyna.actor.home.rot.z; this->dyna.actor.shape.rot.x = this->dyna.actor.world.rot.x; this->dyna.actor.shape.rot.z = this->dyna.actor.world.rot.z; - this->unk_168.y += 18000; - this->dyna.actor.world.pos.y = Math_SinS(this->unk_168.y) + this->dyna.actor.home.pos.y; - this->unk_168.z += 18000; - this->dyna.actor.world.pos.x = Math_SinS(this->unk_168.z) * 3.0f + this->dyna.actor.home.pos.x; - this->dyna.actor.world.pos.z = Math_CosS(this->unk_168.z) * 3.0f + this->dyna.actor.home.pos.z; + this->shakeOrientation.y += 18000; + this->dyna.actor.world.pos.y = Math_SinS(this->shakeOrientation.y) + this->dyna.actor.home.pos.y; + this->shakeOrientation.z += 18000; + this->dyna.actor.world.pos.x = Math_SinS(this->shakeOrientation.z) * 3.0f + this->dyna.actor.home.pos.x; + this->dyna.actor.world.pos.z = Math_CosS(this->shakeOrientation.z) * 3.0f + this->dyna.actor.home.pos.z; } if ((this->timer & 3) == 3) { @@ -181,13 +181,13 @@ void func_80B96678(ObjLift* this, PlayState* play) { } } -void func_80B967C0(ObjLift* this) { - ObjLift_SetupAction(this, func_80B96840); +void ObjLift_SetupFall(ObjLift* this) { + ObjLift_SetupAction(this, ObjLift_Fall); Math_Vec3f_Copy(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos); this->dyna.actor.shape.rot = this->dyna.actor.world.rot = this->dyna.actor.home.rot; } -void func_80B96840(ObjLift* this, PlayState* play) { +void ObjLift_Fall(ObjLift* this, PlayState* play) { s32 pad; s32 bgId; Vec3f pos; @@ -200,7 +200,7 @@ void func_80B96840(ObjLift* this, PlayState* play) { if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= (sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) { - func_80B96160(this, play); + ObjLift_SpawnFragments(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h index de25b3c1c6..6ca27dddac 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.h @@ -11,7 +11,7 @@ typedef void (*ObjLiftActionFunc)(struct ObjLift*, PlayState*); typedef struct ObjLift { /* 0x0000 */ DynaPolyActor dyna; /* 0x0164 */ ObjLiftActionFunc actionFunc; - /* 0x0168 */ Vec3s unk_168; + /* 0x0168 */ Vec3s shakeOrientation; /* 0x016E */ s16 timer; } ObjLift; // size = 0x0170