From 53b0114464408d882d58bebd783898c6af632cf7 Mon Sep 17 00:00:00 2001 From: cadmic Date: Wed, 7 Feb 2024 15:58:46 -0800 Subject: [PATCH] Match InitDynaPoly actors (#1733) * Match InitDynaPoly actors * Change BgJyaBombiwa_SetupDynaPoly pads to s32 * kzIceScale -> sKingZoraRedIceScale --- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 10 ++++-- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 5 ++- .../z_bg_jya_amishutter.c | 6 +++- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 7 ++-- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 9 ++++- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 6 +++- .../z_bg_jya_zurerukabe.c | 6 +++- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 5 ++- .../ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c | 10 +++--- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 8 +++-- .../z_bg_spot08_iceblock.c | 6 +++- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 18 ++++++---- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 6 +++- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 16 ++++----- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 28 +++++++-------- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 13 ++++--- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 6 +++- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 5 ++- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 36 ++++++++++--------- .../actors/ovl_Obj_Switch/z_obj_switch.c | 5 ++- 20 files changed, 137 insertions(+), 74 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 2a862c4631..a3c81e8292 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -115,17 +115,20 @@ void BgIceShelter_InitColliders(BgIceShelter* this, PlayState* play) { void BgIceShelter_InitDynaPoly(BgIceShelter* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG registration failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_ice_shelter.c", 362, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgIceShelter_RotateY(Vec3f* dest, Vec3f* src, s16 angle) { @@ -144,7 +147,6 @@ static InitChainEntry sInitChain[] = { }; void BgIceShelter_Init(Actor* thisx, PlayState* play) { - static Vec3f kzIceScale = { 0.18f, 0.27f, 0.24f }; BgIceShelter* this = (BgIceShelter*)thisx; s16 type = BGICESHELTER_GET_TYPE(&this->dyna.actor); @@ -158,7 +160,9 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { } if (type == RED_ICE_KING_ZORA) { - Math_Vec3f_Copy(&this->dyna.actor.scale, &kzIceScale); + static Vec3f sKingZoraRedIceScale = { 0.18f, 0.27f, 0.24f }; + + Math_Vec3f_Copy(&this->dyna.actor.scale, &sKingZoraRedIceScale); } else { Actor_SetScale(&this->dyna.actor, sRedIceScales[type]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index e9632360db..fa7d9a9dc5 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -69,17 +69,20 @@ static InitChainEntry sInitChain[] = { void BgJya1flift_InitDynapoly(BgJya1flift* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_1flift.c", 179, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJya1flift_InitCollision(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c index 4df5b39ed3..87cb2807dc 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c +++ b/src/overlays/actors/ovl_Bg_Jya_Amishutter/z_bg_jya_amishutter.c @@ -45,15 +45,19 @@ static InitChainEntry sInitChain[] = { void BgJyaAmishutter_InitDynaPoly(BgJyaAmishutter* this, PlayState* play, CollisionHeader* collision, s32 flag) { s32 pad1; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_amishutter.c", 129, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaAmishutter_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index b03f841e3c..c8dfb31195 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -63,19 +63,22 @@ static InitChainEntry sInitChain[] = { }; void BgJyaBombiwa_SetupDynaPoly(BgJyaBombiwa* this, PlayState* play, CollisionHeader* collision, s32 flag) { - s16 pad1; + s32 pad1; CollisionHeader* colHeader = NULL; - s16 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; // "Warning: move BG registration failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_bombiwa.c", 174, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 02b42c4ce8..78f5a1f5e4 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -118,27 +118,34 @@ void func_808958F0(Vec3f* dest, Vec3f* src, f32 arg2, f32 arg3) { void BgJyaCobra_InitDynapoly(BgJyaCobra* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG Registration Failure" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_cobra.c", 247, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaCobra_SpawnRay(BgJyaCobra* this, PlayState* play) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_MIR_RAY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y + 57.0f, this->dyna.actor.world.pos.z, 0, 0, 0, 6); + +#if OOT_DEBUG if (this->dyna.actor.child == NULL) { PRINTF(VT_FGCOL(RED)); // "Error : Mir Ray occurrence failure" PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_cobra.c", 270); PRINTF(VT_RST); } +#endif } void func_80895A70(BgJyaCobra* this) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index f8ef9d42de..4a56ed44e8 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -43,15 +43,19 @@ static InitChainEntry sInitChain[] = { void BgJyaKanaami_InitDynaPoly(BgJyaKanaami* this, PlayState* play, CollisionHeader* collision, s32 flag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_kanaami.c", 145, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgJyaKanaami_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c index 2a4181eefd..378116f72a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c +++ b/src/overlays/actors/ovl_Bg_Jya_Zurerukabe/z_bg_jya_zurerukabe.c @@ -62,15 +62,19 @@ static InitChainEntry sInitChain[] = { void BgJyaZurerukabe_InitDynaPoly(BgJyaZurerukabe* this, PlayState* play, CollisionHeader* collision, s32 flag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_jya_zurerukabe.c", 194, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void func_8089B4C8(BgJyaZurerukabe* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 18e1eaaafd..9cb6034bc2 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -53,17 +53,20 @@ void BgMoriBigst_SetupAction(BgMoriBigst* this, BgMoriBigstActionFunc actionFunc void BgMoriBigst_InitDynapoly(BgMoriBigst* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_bigst.c", 190, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgMoriBigst_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c index e4be790154..a31345545c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashigo/z_bg_mori_hashigo.c @@ -78,19 +78,21 @@ static InitChainEntry sInitChainLadder[] = { void BgMoriHashigo_InitDynapoly(BgMoriHashigo* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; - CollisionHeader* colHeader; - s32 pad2; + CollisionHeader* colHeader = NULL; - colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashigo.c", 164, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgMoriHashigo_InitCollider(BgMoriHashigo* this, PlayState* play) { @@ -260,9 +262,9 @@ void BgMoriHashigo_LadderFall(BgMoriHashigo* this, PlayState* play) { } void BgMoriHashigo_SetupLadderRest(BgMoriHashigo* this) { - this->actionFunc = NULL; this->dyna.actor.gravity = 0.0f; this->dyna.actor.velocity.y = 0.0f; + this->actionFunc = NULL; this->dyna.actor.world.pos.y = this->dyna.actor.floorHeight; } diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index e4b2a1217f..5f5af22350 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -50,19 +50,21 @@ void BgMoriHashira4_SetupAction(BgMoriHashira4* this, BgMoriHashira4ActionFunc a void BgMoriHashira4_InitDynaPoly(BgMoriHashira4* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; - CollisionHeader* colHeader; - s32 pad2; + CollisionHeader* colHeader = NULL; - colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG login failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_mori_hashira4.c", 155, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index f5ced0b3f6..3ad8321f17 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -41,16 +41,20 @@ void BgSpot08Iceblock_SetupAction(BgSpot08Iceblock* this, BgSpot08IceblockAction void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning: move BG registration failed" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot08_iceblock.c", 0xD9, this->dyna.actor.id, this->dyna.actor.params); } +#endif } // Sets params to 0x10 (medium, nonrotating) if not in the cases listed. diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index e261a35239..2a62445f48 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -46,15 +46,19 @@ static InitChainEntry sInitChain[] = { void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_gate.c", 145, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgSpot12Gate_Init(Actor* thisx, PlayState* play) { @@ -105,17 +109,19 @@ void func_808B317C(BgSpot12Gate* this) { void func_808B318C(BgSpot12Gate* this, PlayState* play) { s32 pad; - s32 quakeIndex; Math_StepToF(&this->dyna.actor.velocity.y, 1.6f, 0.03f); if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y)) { func_808B3274(this); - quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); - Quake_SetSpeed(quakeIndex, -0x3CB0); - Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0); - Quake_SetDuration(quakeIndex, 12); + { + s32 quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); + + Quake_SetSpeed(quakeIndex, -0x3CB0); + Quake_SetPerturbations(quakeIndex, 3, 0, 0, 0); + Quake_SetDuration(quakeIndex, 12); + } Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BRIDGE_OPEN_STOP); } else { diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 9700367f4b..360464957c 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -43,15 +43,19 @@ static InitChainEntry sInitChain[] = { void func_808B3420(BgSpot12Saku* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot12_saku.c", 140, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index a2ce895d76..5a8560df82 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -58,17 +58,19 @@ static Vec3f sBoxGroundCheckPoints[] = { void func_808B3960(BgSpot15Rrbox* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - u32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_bg_spot15_rrbox.c", 171, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void BgSpot15Rrbox_RotatePoint(Vec3f* outPos, Vec3f* pos, f32 arg2, f32 arg3) { @@ -224,11 +226,9 @@ s32 func_808B4010(BgSpot15Rrbox* this, PlayState* play) { } void func_808B4084(BgSpot15Rrbox* this, PlayState* play) { - this->actionFunc = func_808B40AC; this->dyna.actor.gravity = 0.0f; - this->dyna.actor.velocity.x = 0.0f; - this->dyna.actor.velocity.y = 0.0f; - this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; + this->actionFunc = func_808B40AC; } void func_808B40AC(BgSpot15Rrbox* this, PlayState* play) { @@ -301,9 +301,7 @@ void func_808B4194(BgSpot15Rrbox* this, PlayState* play) { } void func_808B4380(BgSpot15Rrbox* this, PlayState* play) { - this->dyna.actor.velocity.x = 0.0f; - this->dyna.actor.velocity.y = 0.0f; - this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.gravity = -1.0f; this->dyna.actor.floorHeight = BgSpot15Rrbox_GetFloorHeight(this, play); this->actionFunc = func_808B43D0; diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 69351a718e..ba2521531d 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -135,19 +135,20 @@ void ObjBean_InitCollider(Actor* thisx, PlayState* play) { void ObjBean_InitDynaPoly(ObjBean* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; - CollisionHeader* colHeader; - s32 pad2; - - colHeader = NULL; + CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_bean.c", 374, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjBean_FindFloor(ObjBean* this, PlayState* play) { @@ -240,14 +241,8 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { Path* path; Vec3f acell; Vec3f pathPointsFloat; - f32 speed; - Vec3s* nextPathPoint; - Vec3s* currentPoint; - Vec3s* sp4C; - Vec3f sp40; - Vec3f sp34; - f32 sp30; f32 mag; + Vec3s* nextPathPoint; Math_StepToF(&this->dyna.actor.speed, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel); path = &play->pathList[(this->dyna.actor.params >> 8) & 0x1F]; @@ -257,8 +252,13 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { Math_Vec3f_Diff(&pathPointsFloat, &this->pathPoints, &acell); mag = Math3D_Vec3fMagnitude(&acell); - speed = CLAMP_MIN(this->dyna.actor.speed, 0.5f); - if (speed > mag) { + if (CLAMP_MIN(this->dyna.actor.speed, 0.5f) > mag) { + Vec3s* currentPoint; + Vec3s* sp4C; + Vec3f sp40; + Vec3f sp34; + f32 sp30; + currentPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->currentPointIndex]; Math_Vec3f_Copy(&this->pathPoints, &pathPointsFloat); diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index fa22cfaab4..0cd7062bdf 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -46,16 +46,19 @@ void ObjElevator_SetupAction(ObjElevator* this, ObjElevatorActionFunc actionFunc void func_80B92B08(ObjElevator* this, PlayState* play, CollisionHeader* collision, s32 flag) { s16 pad1; CollisionHeader* colHeader = NULL; - s16 pad2; - Actor* thisx = &this->dyna.actor; DynaPolyActor_Init(&this->dyna, flag); CollisionHeader_GetVirtual(collision, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { - PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136, thisx->id, - thisx->params); + s32 pad2; + + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_elevator.c", 136, + this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjElevator_Init(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index f399f017ef..602502f9bb 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -55,15 +55,19 @@ void ObjHsblock_SetupAction(ObjHsblock* this, ObjHsblockActionFunc actionFunc) { void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision, s32 moveFlags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2[2]; DynaPolyActor_Init(&this->dyna, moveFlags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); + +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_hsblock.c", 163, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void func_80B93BF0(ObjHsblock* this, PlayState* play) { 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 63f6635a30..52859a628c 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -64,16 +64,19 @@ void ObjLift_SetupAction(ObjLift* this, ObjLiftActionFunc actionFunc) { void ObjLift_InitDynaPoly(ObjLift* this, PlayState* play, CollisionHeader* collision, s32 flags) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, flags); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_lift.c", 188, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index b8b6fbcf2f..6243acb0bd 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -87,17 +87,20 @@ static Vec2f sFaceDirection[] = { void ObjOshihiki_InitDynapoly(ObjOshihiki* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG registration failure" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_oshihiki.c", 280, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjOshihiki_RotateXZ(Vec3f* out, Vec3f* in, f32 sn, f32 cs) { @@ -242,14 +245,13 @@ void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { } } -void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play) { - Color_RGB8* src; +void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play2) { + PlayState* play = play2; + s16 paramsColorIdx = (this->dyna.actor.params >> 6) & 3; Color_RGB8* color = &this->color; - s16 paramsColorIdx; + Color_RGB8* src; s32 i; - paramsColorIdx = (this->dyna.actor.params >> 6) & 3; - for (i = 0; i < ARRAY_COUNT(sSceneIds); i++) { if (sSceneIds[i] == play->sceneId) { break; @@ -315,14 +317,12 @@ void ObjOshihiki_Destroy(Actor* thisx, PlayState* play) { } void ObjOshihiki_SetFloors(ObjOshihiki* this, PlayState* play) { + s32 pad; + Vec3f colCheckPoint; + Vec3f colCheckOffset; s32 i; for (i = 0; i < 5; i++) { - Vec3f colCheckPoint; - Vec3f colCheckOffset; - CollisionPoly** floorPoly; - s32* floorBgId; - colCheckOffset.x = sColCheckPoints[i].x * (this->dyna.actor.scale.x * 10.0f); colCheckOffset.y = sColCheckPoints[i].y * (this->dyna.actor.scale.y * 10.0f); colCheckOffset.z = sColCheckPoints[i].z * (this->dyna.actor.scale.z * 10.0f); @@ -331,10 +331,8 @@ void ObjOshihiki_SetFloors(ObjOshihiki* this, PlayState* play) { colCheckPoint.y += this->dyna.actor.prevPos.y; colCheckPoint.z += this->dyna.actor.world.pos.z; - floorPoly = &this->floorPolys[i]; - floorBgId = &this->floorBgIds[i]; - this->floorHeights[i] = - BgCheck_EntityRaycastDown6(&play->colCtx, floorPoly, floorBgId, &this->dyna.actor, &colCheckPoint, 0.0f); + this->floorHeights[i] = BgCheck_EntityRaycastDown6(&play->colCtx, &this->floorPolys[i], &this->floorBgIds[i], + &this->dyna.actor, &colCheckPoint, 0.0f); } } @@ -445,9 +443,9 @@ s32 ObjOshihiki_MoveWithBlockUnder(ObjOshihiki* this, PlayState* play) { void ObjOshihiki_SetupOnScene(ObjOshihiki* this, PlayState* play) { this->stateFlags |= PUSHBLOCK_SETUP_ON_SCENE; - this->actionFunc = ObjOshihiki_OnScene; this->dyna.actor.gravity = 0.0f; this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; + this->actionFunc = ObjOshihiki_OnScene; } void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { @@ -472,9 +470,9 @@ void ObjOshihiki_OnScene(ObjOshihiki* this, PlayState* play) { void ObjOshihiki_SetupOnActor(ObjOshihiki* this, PlayState* play) { this->stateFlags |= PUSHBLOCK_SETUP_ON_ACTOR; - this->actionFunc = ObjOshihiki_OnActor; this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; this->dyna.actor.gravity = -1.0f; + this->actionFunc = ObjOshihiki_OnActor; } void ObjOshihiki_OnActor(ObjOshihiki* this, PlayState* play) { @@ -649,6 +647,7 @@ void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_obj_oshihiki.c", 1308), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +#if OOT_DEBUG switch (play->sceneId) { case SCENE_DEKU_TREE: case SCENE_DODONGOS_CAVERN: @@ -664,6 +663,9 @@ void ObjOshihiki_Draw(Actor* thisx, PlayState* play) { gDPSetEnvColor(POLY_OPA_DISP++, mREG(13), mREG(14), mREG(15), 255); break; } +#else + gDPSetEnvColor(POLY_OPA_DISP++, this->color.r, this->color.g, this->color.b, 255); +#endif gSPDisplayList(POLY_OPA_DISP++, gPushBlockDL); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_oshihiki.c", 1334); diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 089c781641..2d513f5c70 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -192,17 +192,20 @@ void ObjSwitch_RotateY(Vec3f* dest, Vec3f* src, s16 rotY) { void ObjSwitch_InitDynaPoly(ObjSwitch* this, PlayState* play, CollisionHeader* collision, s32 moveFlag) { s32 pad; CollisionHeader* colHeader = NULL; - s32 pad2; DynaPolyActor_Init(&this->dyna, moveFlag); CollisionHeader_GetVirtual(collision, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); +#if OOT_DEBUG if (this->dyna.bgId == BG_ACTOR_MAX) { + s32 pad2; + // "Warning : move BG registration failure" PRINTF("Warning : move BG 登録失敗(%s %d)(name %d)(arg_data 0x%04x)\n", "../z_obj_switch.c", 531, this->dyna.actor.id, this->dyna.actor.params); } +#endif } void ObjSwitch_InitJntSphCollider(ObjSwitch* this, PlayState* play, ColliderJntSphInit* colliderJntSphInit) {