diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index b20e9f1c12..cc078dc8bf 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -347,11 +347,13 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Actor_MoveXZGravity(&this->dyna.actor); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); +#if OOT_DEBUG if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) { // "[Hammer Step] arg_data strange (arg_data = %d)" PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } +#endif if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) && diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 0d476066de..ce8149375f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -82,6 +82,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { s32 i; s32 j; CollisionHeader* collisionHeader = NULL; + Vec3f* vtx; Actor_ProcessInitChain(thisx, sInitChain); this->unk_16A = thisx->params & 0x3F; @@ -103,7 +104,7 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { if (1) { for (j = 0; j < 3; j++) { - Vec3f* vtx = &colliderElementInit->dim.vtx[j]; + vtx = &colliderElementInit->dim.vtx[j]; vertices[j].x = vtx->z * sinRotY + (thisx->home.pos.x + vtx->x * cosRotY); vertices[j].y = vtx->y + thisx->home.pos.y; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 4bcee5a11a..c7890ace87 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -73,9 +73,12 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { ((s32)thisx->params >> 8) & 0xFF); Actor_ProcessInitChain(thisx, sInitChain); + +#if OOT_DEBUG if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) { PRINTF("arg_data おかしい 【格子】\n"); } +#endif CollisionHeader_GetVirtual(sMetalFencesCollisions[thisx->params & 0xFF], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c index 0e0f1f6062..9cba8f54de 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Sekizou/z_bg_hidan_sekizou.c @@ -130,9 +130,10 @@ void func_8088CEC0(BgHidanSekizou* this, s32 arg1, s16 arg2) { s32 end = start + 3; f32 sp30 = Math_SinS(arg2); f32 sp2C = Math_CosS(arg2); + ColliderJntSphElement* element; for (i = start; i < end; i++) { - ColliderJntSphElement* element = &this->collider.elements[i]; + element = &this->collider.elements[i]; element->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + (sp2C * element->dim.modelSphere.center.x) + (sp30 * element->dim.modelSphere.center.z); @@ -301,8 +302,8 @@ Gfx* func_8088D9F4(PlayState* play, BgHidanSekizou* this, s16 arg2, MtxF* arg3, f32 phi_f12; arg6 = (((arg6 + arg2) % 8) * 7) * (1 / 7.0f); - arg2++; gSPSegment(arg7++, 9, SEGMENTED_TO_VIRTUAL(sFireballsTexs[arg6])); + arg2++; if (arg2 != 4) { phi_f12 = arg2 + ((4 - this->unk_170) / 4.0f); } else { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 343b1250c0..0d8f5a34d2 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -49,7 +49,6 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { f32 sp24; CollisionHeader* colHeader; s32 sp28; - f32 temp_f6; colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -78,7 +77,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { } if (sp28 == 2) { - temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f; + f32 temp_f6 = Math_SinS(this->dyna.actor.shape.rot.x) * 50.0f; + this->dyna.actor.focus.pos.x = (Math_SinS(this->dyna.actor.shape.rot.y) * temp_f6) + this->dyna.actor.home.pos.x; this->dyna.actor.focus.pos.y = this->dyna.actor.home.pos.y; diff --git a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index a66909bd6c..a8e3c1ad7e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -74,10 +74,12 @@ void BgJyaBigmirror_HandleCobra(Actor* thisx, PlayState* play) { this->puzzleFlags &= ~cobraPuzzleFlags[i]; } +#if OOT_DEBUG if (curCobraInfo->cobra->dyna.actor.update == NULL) { // "Cobra deleted" PRINTF("Error : コブラ削除された (%s %d)\n", "../z_bg_jya_bigmirror.c", 203); } +#endif } else { curCobraInfo->cobra = (BgJyaCobra*)Actor_SpawnAsChild( &play->actorCtx, &this->actor, play, ACTOR_BG_JYA_COBRA, curSpawnData->pos.x, curSpawnData->pos.y, @@ -136,17 +138,10 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) { this->lightBeams[1] = NULL; this->lightBeams[0] = NULL; } else { - puzzleSolved = !!(this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM)); - - if (puzzleSolved) { - puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED); - - if (puzzleSolved) { - puzzleSolved = !!(this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED); - } - } - lightBeamToggles[0] = puzzleSolved; // Only spawn if puzzle solved - if (1) {} + // Only spawn if puzzle solved + lightBeamToggles[0] = (this->puzzleFlags & (BIGMIR_PUZZLE_IN_STATUE_ROOM | BIGMIR_PUZZLE_IN_1ST_TOP_ROOM)) && + (this->puzzleFlags & BIGMIR_PUZZLE_COBRA2_SOLVED) && + (this->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED); lightBeamToggles[1] = lightBeamToggles[2] = this->puzzleFlags & (BIGMIR_PUZZLE_IN_1ST_TOP_ROOM | BIGMIR_PUZZLE_IN_2ND_TOP_ROOM); @@ -158,10 +153,12 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, sMirRayPositions[i].x, sMirRayPositions[i].y, sMirRayPositions[i].z, 0, 0, 0, sMirRayParamsVals[i]); +#if OOT_DEBUG if (this->lightBeams[i] == NULL) { // "Mir Ray generation failed" PRINTF("Error : Mir Ray 発生失敗 (%s %d)\n", "../z_bg_jya_bigmirror.c", 310); } +#endif } } else { if (this->lightBeams[i] != NULL) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index af9ced88f4..6ef2ddd84c 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -106,10 +106,13 @@ void BgJyaIronobj_SpawnPillarParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 sins; s32 pad[2]; +#if OOT_DEBUG if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 233, enIk->unk_2FF); return; } +#endif + PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF); rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1]; @@ -169,10 +172,13 @@ void BgJyaIronobj_SpawnThroneParticles(BgJyaIronobj* this, PlayState* play, EnIk f32 sins; s32 pad[2]; +#if OOT_DEBUG if (enIk->unk_2FF <= 0 || enIk->unk_2FF >= 4) { PRINTF("Error 攻撃方法が分からない(%s %d)\n", "../z_bg_jya_ironobj.c", 362, enIk->unk_2FF); return; } +#endif + PRINTF("¢ attack_type(%d)\n", enIk->unk_2FF); rotY = Actor_WorldYawTowardActor(&this->dyna.actor, &enIk->actor) + D_808994D8[enIk->unk_2FF - 1]; for (i = 0; i < 8; i++) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 788f16adff..4acd8fbf03 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -217,10 +217,11 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) { void BgJyaMegami_SetupExplode(BgJyaMegami* this) { u32 i; + Vec3f* pos = &this->dyna.actor.world.pos; this->actionFunc = BgJyaMegami_Explode; for (i = 0; i < ARRAY_COUNT(this->pieces); i++) { - Math_Vec3f_Copy(&this->pieces[i].pos, &this->dyna.actor.world.pos); + Math_Vec3f_Copy(&this->pieces[i].pos, pos); this->pieces[i].vel.x = sPiecesInit[i].velX; } this->explosionTimer = 0; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 0ab3facdac..f829706fc5 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -182,7 +182,14 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); switch ((u16)this->dyna.actor.params & 0xF) { - case MIZUBWALL_FLOOR: + case MIZUBWALL_FLOOR: { + f32 sin; + f32 cos; + s32 i; + s32 j; + Vec3f offset; + Vec3f vtx[3]; + if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -194,12 +201,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -217,7 +220,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } break; - case MIZUBWALL_RUTO_ROOM: + } + case MIZUBWALL_RUTO_ROOM: { + f32 sin; + f32 cos; + s32 i; + s32 j; + Vec3f offset; + Vec3f vtx[3]; + if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -229,12 +240,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) { for (j = 0; j < 3; j++) { @@ -252,7 +259,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } break; - case MIZUBWALL_UNUSED: + } + case MIZUBWALL_UNUSED: { + f32 sin; + f32 cos; + s32 i; + s32 j; + Vec3f offset; + Vec3f vtx[3]; + if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -264,12 +279,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -289,7 +300,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } break; - case MIZUBWALL_STINGER_ROOM_1: + } + case MIZUBWALL_STINGER_ROOM_1: { + f32 sin; + f32 cos; + s32 i; + s32 j; + Vec3f offset; + Vec3f vtx[3]; + if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -302,12 +321,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -327,7 +342,15 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } break; - case MIZUBWALL_STINGER_ROOM_2: + } + case MIZUBWALL_STINGER_ROOM_2: { + f32 sin; + f32 cos; + s32 i; + s32 j; + Vec3f offset; + Vec3f vtx[3]; + if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; @@ -340,12 +363,8 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { this->dyna.actor.params); Actor_Kill(&this->dyna.actor); } else { - f32 sin = Math_SinS(this->dyna.actor.shape.rot.y); - f32 cos = Math_CosS(this->dyna.actor.shape.rot.y); - s32 i; - s32 j; - Vec3f offset; - Vec3f vtx[3]; + sin = Math_SinS(this->dyna.actor.shape.rot.y); + cos = Math_CosS(this->dyna.actor.shape.rot.y); for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (j = 0; j < 3; j++) { @@ -365,6 +384,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } } break; + } } } @@ -377,9 +397,8 @@ void BgMizuBwall_Destroy(Actor* thisx, PlayState* play) { } void BgMizuBwall_SetAlpha(BgMizuBwall* this, PlayState* play) { - f32 waterLevel = play->colCtx.colHeader->waterBoxes[2].ySurface; - - if (play->colCtx.colHeader->waterBoxes) {} + WaterBox* waterBoxes = play->colCtx.colHeader->waterBoxes; + f32 waterLevel = waterBoxes[2].ySurface; if (waterLevel < WATER_TEMPLE_WATER_F1_Y) { this->scrollAlpha1 = 255; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 050f850aaa..c0071bed5c 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -53,6 +53,7 @@ static InitChainEntry sInitChain[] = { u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) { u32 ret; +#if OOT_DEBUG if (bREG(0) != 0) { switch (bREG(1)) { case 0: @@ -67,6 +68,8 @@ u32 BgMizuWater_GetWaterLevelActionIndex(s16 switchFlag, PlayState* play) { } bREG(0) = 0; } +#endif + if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F1_FLAG)) { ret = 3; } else if (Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG) && (switchFlag != WATER_TEMPLE_WATER_F2_FLAG)) { @@ -297,10 +300,13 @@ void BgMizuWater_Update(Actor* thisx, PlayState* play) { s32 unk1; s32 pad; +#if OOT_DEBUG if (bREG(15) == 0) { PRINTF("%x %x %x\n", Flags_GetSwitch(play, WATER_TEMPLE_WATER_F1_FLAG), Flags_GetSwitch(play, WATER_TEMPLE_WATER_F2_FLAG), Flags_GetSwitch(play, WATER_TEMPLE_WATER_F3_FLAG)); } +#endif + if (this->type == 0) { posY = this->actor.world.pos.y; unk0 = 0; diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 12072ce5ff..8b50d4b5dd 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -88,27 +88,31 @@ void BgMoriElevator_Init(Actor* thisx, PlayState* play) { this->unk_172 = sIsSpawned; this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); + +#if OOT_DEBUG if (this->moriTexObjectSlot < 0) { Actor_Kill(thisx); // "Forest Temple obj elevator Bank Danger!" PRINTF("Error : 森の神殿 obj elevator バンク危険!(%s %d)\n", "../z_bg_mori_elevator.c", 277); - } else { - switch (sIsSpawned) { - case false: - // "Forest Temple elevator CT" - PRINTF("森の神殿 elevator CT\n"); - sIsSpawned = true; - this->dyna.actor.room = -1; - Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - CollisionHeader_GetVirtual(&gMoriElevatorCol, &colHeader); - this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - BgMoriElevator_SetupWaitAfterInit(this); - break; - case true: - Actor_Kill(thisx); - break; - } + return; + } +#endif + + switch (sIsSpawned) { + case false: + // "Forest Temple elevator CT" + PRINTF("森の神殿 elevator CT\n"); + sIsSpawned = true; + this->dyna.actor.room = -1; + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); + DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); + CollisionHeader_GetVirtual(&gMoriElevatorCol, &colHeader); + this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); + BgMoriElevator_SetupWaitAfterInit(this); + break; + case true: + Actor_Kill(thisx); + break; } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c index 74d4621487..cab9eed7d5 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c +++ b/src/overlays/actors/ovl_Bg_Mori_Rakkatenjo/z_bg_mori_rakkatenjo.c @@ -12,7 +12,7 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play); void BgMoriRakkatenjo_Destroy(Actor* thisx, PlayState* play); -void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play); +void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play2); void BgMoriRakkatenjo_Draw(Actor* thisx, PlayState* play); void BgMoriRakkatenjo_SetupWaitForMoriTex(BgMoriRakkatenjo* this); @@ -52,6 +52,8 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); + +#if OOT_DEBUG // "Forest Temple obj. Falling Ceiling" PRINTF("森の神殿 obj. 落下天井 (home posY %f)\n", this->dyna.actor.home.pos.y); if ((fabsf(1991.0f - this->dyna.actor.home.pos.x) > 0.001f) || @@ -64,6 +66,8 @@ void BgMoriRakkatenjo_Init(Actor* thisx, PlayState* play) { // "The set Angle has changed. Let's fix the program." PRINTF("Warning : セット Angle が変更されています。プログラムを修正しましょう。\n"); } +#endif + this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); if (this->moriTexObjectSlot < 0) { // "Forest Temple obj Falling Ceiling Bank Danger!" @@ -197,8 +201,8 @@ void BgMoriRakkatenjo_Rise(BgMoriRakkatenjo* this, PlayState* play) { } } -void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play) { - s32 pad; +void BgMoriRakkatenjo_Update(Actor* thisx, PlayState* play2) { + PlayState* play = (PlayState*)play2; BgMoriRakkatenjo* this = (BgMoriRakkatenjo*)thisx; if (this->timer > 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c index 3a8815ea2f..1fafea47cd 100644 --- a/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c +++ b/src/overlays/actors/ovl_Bg_Spot00_Hanebasi/z_bg_spot00_hanebasi.c @@ -197,8 +197,9 @@ void BgSpot00Hanebasi_SetTorchLightInfo(BgSpot00Hanebasi* this, PlayState* play) } void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { - BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx; s32 pad; + BgSpot00Hanebasi* this = (BgSpot00Hanebasi*)thisx; + Player* player; this->actionFunc(this, play); @@ -206,7 +207,7 @@ void BgSpot00Hanebasi_Update(Actor* thisx, PlayState* play) { if (play->sceneId == SCENE_HYRULE_FIELD) { if (CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD) && CHECK_QUEST_ITEM(QUEST_GORON_RUBY) && CHECK_QUEST_ITEM(QUEST_ZORA_SAPPHIRE) && !GET_EVENTCHKINF(EVENTCHKINF_80) && LINK_IS_CHILD) { - Player* player = GET_PLAYER(play); + player = GET_PLAYER(play); if ((player->actor.world.pos.x > -450.0f) && (player->actor.world.pos.x < 450.0f) && (player->actor.world.pos.z > 1080.0f) && (player->actor.world.pos.z < 1700.0f) && diff --git a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c index 513b8c20b3..a8e6ce6559 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Idohashira/z_bg_spot01_idohashira.c @@ -117,10 +117,11 @@ void func_808AAE6C(BgSpot01Idohashira* this, PlayState* play) { void func_808AAF34(BgSpot01Idohashira* this, PlayState* play) { s32 pad[2]; - Vec3f dest; - Vec3f src; if (this->unk_170 != 0) { + Vec3f dest; + Vec3f src; + src.x = kREG(20) + 1300.0f; src.y = kREG(21) + 200.0f; src.z = 0.0f; @@ -170,13 +171,11 @@ void func_808AB18C(BgSpot01Idohashira* this) { f32 func_808AB1DC(f32 arg0, f32 arg1, u16 arg2, u16 arg3, u16 arg4) { f32 temp_f12; f32 regFloat; - f32 diff23; - f32 diff43; + f32 diff23 = arg2 - arg3; + f32 diff43 = arg4 - arg3; - diff23 = arg2 - arg3; if (diff23 != 0.0f) { regFloat = kREG(9) + 30.0f; - diff43 = arg4 - arg3; temp_f12 = regFloat * diff43; return (((((arg1 - arg0) - temp_f12) / SQ(diff23)) * diff43) * diff43) + temp_f12; } diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index a652df6420..1f1f9da166 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -13,8 +13,8 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play); void BgSpot02Objects_Destroy(Actor* thisx, PlayState* play); void BgSpot02Objects_Update(Actor* thisx, PlayState* play); void BgSpot02Objects_Draw(Actor* thisx, PlayState* play); -void func_808ACCB8(Actor* thisx, PlayState* play); -void func_808AD450(Actor* thisx, PlayState* play); +void func_808ACCB8(Actor* thisx, PlayState* play2); +void func_808AD450(Actor* thisx, PlayState* play2); void func_808AC8FC(BgSpot02Objects* this, PlayState* play); void func_808AC908(BgSpot02Objects* this, PlayState* play); @@ -212,10 +212,10 @@ void func_808ACC34(BgSpot02Objects* this, PlayState* play) { } } -void func_808ACCB8(Actor* thisx, PlayState* play) { +void func_808ACCB8(Actor* thisx, PlayState* play2) { BgSpot02Objects* this = (BgSpot02Objects*)thisx; + PlayState* play = (PlayState*)play2; f32 rate; - s32 pad; u8 redPrim; u8 greenPrim; u8 bluePrim; @@ -225,6 +225,8 @@ void func_808ACCB8(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 600); + if (1) {} + if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[0] != NULL && play->csCtx.actorCues[0]->id == 2) { if (this->unk_16A < 5) { rate = (this->unk_16A / 5.0f); @@ -278,9 +280,9 @@ void func_808AD3D4(BgSpot02Objects* this, PlayState* play) { } } -void func_808AD450(Actor* thisx, PlayState* play) { +void func_808AD450(Actor* thisx, PlayState* play2) { BgSpot02Objects* this = (BgSpot02Objects*)thisx; - s32 pad; + PlayState* play = (PlayState*)play2; f32 lerp; OPEN_DISPS(play->state.gfxCtx, "../z_bg_spot02_objects.c", 736); diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index ff24dcc5ca..78d1e3d376 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -147,6 +147,8 @@ void BgSpot03Taki_Draw(Actor* thisx, PlayState* play) { gSPDisplayList(POLY_XLU_DISP++, object_spot03_object_DL_001580); + if (1) {} + CLOSE_DISPS(play->state.gfxCtx, "../z_bg_spot03_taki.c", 358); this->bufferIndex = this->bufferIndex == 0; diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 8784b28e24..1729cc935c 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -111,11 +111,12 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { if (LINK_IS_ADULT && Flags_GetSwitch(play, this->switchFlag)) { thisx->world.pos.y = thisx->home.pos.y + 120.0f; this->actionFunc = BgSpot06Objects_DoNothing; - } else { this->actionFunc = BgSpot06Objects_GateWaitForSwitch; } + if (1) {} + break; case LHO_WATER_TEMPLE_ENTRANCE_LOCK: Actor_ProcessInitChain(thisx, sInitChain); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c index c65737af97..ff7c8e28ba 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Oasis/z_bg_spot11_oasis.c @@ -125,7 +125,6 @@ void BgSpot11Oasis_Update(Actor* thisx, PlayState* play) { BgSpot11Oasis* this = (BgSpot11Oasis*)thisx; s32 pad; u32 gameplayFrames; - Vec3f sp30; this->actionFunc(this, play); if (this->actionFunc == func_808B2980) { @@ -136,6 +135,8 @@ void BgSpot11Oasis_Update(Actor* thisx, PlayState* play) { if (this->unk_150 && (this->actor.projectedPos.z < 400.0f) && (this->actor.projectedPos.z > -40.0f)) { gameplayFrames = play->gameplayFrames; if (gameplayFrames & 4) { + Vec3f sp30; + Math_Vec3f_Sum(&this->actor.world.pos, &D_808B2E34[this->unk_151], &sp30); EffectSsBubble_Spawn(play, &sp30, 0.0f, 15.0f, 50.0f, (Rand_ZeroOne() * 0.12f) + 0.02f); if (Rand_ZeroOne() < 0.3f) { diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 7a7a485617..c147daa300 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -230,8 +230,8 @@ s32 func_808B4E58(BgSpot16Bombstone* this, PlayState* play) { } void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { + s16 shouldLive = true; BgSpot16Bombstone* this = (BgSpot16Bombstone*)thisx; - s16 shouldLive; func_808B4C30(this); @@ -240,6 +240,7 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { // The boulder is intact shouldLive = func_808B4D9C(this, play); break; + case 0: case 1: case 2: @@ -249,11 +250,14 @@ void BgSpot16Bombstone_Init(Actor* thisx, PlayState* play) { // The boulder is debris shouldLive = func_808B4E58(this, play); break; + +#if OOT_DEBUG default: PRINTF("Error : arg_data おかしいな(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot16_bombstone.c", 668, this->actor.params); shouldLive = false; break; +#endif } if (!shouldLive) { @@ -451,12 +455,14 @@ void func_808B5950(BgSpot16Bombstone* this, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); } +#if OOT_DEBUG if (mREG(64) == 1) { func_808B561C(this, play); mREG(64) = -10; } else if (mREG(64) < 0) { mREG(64)++; } +#endif } void func_808B5A78(BgSpot16Bombstone* this) { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 84ca72ef57..6eae47eb98 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -91,33 +91,33 @@ void func_808B7770(BgSpot18Basket* this, PlayState* play, f32 arg2) { s32 i; f32 randomValue; f32 sinValue; - s32 count; - for (i = 0, count = 2; i != count; i++) { - if (play) {} - if (!(arg2 < Rand_ZeroOne())) { - D_808B85D0 += 0x7530; - - sinValue = Math_SinS(D_808B85D0); - cosValue = Math_CosS(D_808B85D0); - - randomValue = (Rand_ZeroOne() * 35.0f) + 35.0f; - - position.x = (randomValue * sinValue) + this->dyna.actor.world.pos.x; - position.y = this->dyna.actor.world.pos.y + 10.0f; - position.z = (randomValue * cosValue) + this->dyna.actor.world.pos.z; - - velocity.x = sinValue; - velocity.y = 0.0f; - velocity.z = cosValue; - - acceleration.x = 0.0f; - acceleration.y = 0.5f; - acceleration.z = 0.0f; - - func_800286CC(play, &position, &velocity, &acceleration, ((Rand_ZeroOne() * 16) + 80), - ((Rand_ZeroOne() * 30) + 80)); + for (i = 0; i != 2; i++) { + if (arg2 < Rand_ZeroOne()) { + continue; } + + D_808B85D0 += 0x7530; + + sinValue = Math_SinS(D_808B85D0); + cosValue = Math_CosS(D_808B85D0); + + randomValue = (Rand_ZeroOne() * 35.0f) + 35.0f; + + position.x = (randomValue * sinValue) + this->dyna.actor.world.pos.x; + position.y = this->dyna.actor.world.pos.y + 10.0f; + position.z = (randomValue * cosValue) + this->dyna.actor.world.pos.z; + + velocity.x = sinValue; + velocity.y = 0.0f; + velocity.z = cosValue; + + acceleration.x = 0.0f; + acceleration.y = 0.5f; + acceleration.z = 0.0f; + + func_800286CC(play, &position, &velocity, &acceleration, ((Rand_ZeroOne() * 16) + 80), + ((Rand_ZeroOne() * 30) + 80)); } } @@ -240,9 +240,6 @@ void func_808B7D38(BgSpot18Basket* this) { } void func_808B7D50(BgSpot18Basket* this, PlayState* play) { - f32 tempValue2; - f32 tempValue; - if (this->unk_216 > 120) { Math_StepToS(&this->unk_210, 0x3E8, 0x32); } else { @@ -281,11 +278,12 @@ void func_808B7D50(BgSpot18Basket* this, PlayState* play) { func_808B7770(this, play, 0.8f); } - tempValue2 = (this->unk_210 - 500) * 0.0006f; + { + f32 tempValue2 = (this->unk_210 - 500) * 0.0006f; + f32 tempValue = CLAMP(tempValue2, 0.0f, 1.5f); - tempValue = CLAMP(tempValue2, 0.0f, 1.5f); - - func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, tempValue); + func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, tempValue); + } } void func_808B7F74(BgSpot18Basket* this) { @@ -308,9 +306,7 @@ void func_808B7F74(BgSpot18Basket* this) { void func_808B7FC0(BgSpot18Basket* this, PlayState* play) { s32 pad; s32 tempUnk214; - f32 tempUnk210; s16 arrayValue; - f32 clampedTempUnk210; this->unk_212 += 0xBB8; @@ -343,11 +339,12 @@ void func_808B7FC0(BgSpot18Basket* this, PlayState* play) { func_808B7770(this, play, 0.3f); } - tempUnk210 = (this->unk_210 - 500) * 0.0006f; + { + f32 tempUnk210 = (this->unk_210 - 500) * 0.0006f; + f32 clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f); - clampedTempUnk210 = CLAMP(tempUnk210, 0.0f, 1.5f); - - func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, clampedTempUnk210); + func_800F436C(&this->dyna.actor.projectedPos, NA_SE_EV_WALL_MOVE_SP - SFX_FLAG, clampedTempUnk210); + } } void func_808B818C(BgSpot18Basket* this) { diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 6b3d8095a8..4c284b9b15 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -111,7 +111,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { case 2: PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202, this->dyna.actor.params); - break; + return 0; default: PRINTF("Error : Obj出現判定失敗(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 210, this->dyna.actor.params); @@ -235,11 +235,9 @@ void func_808B8E7C(BgSpot18Obj* this, PlayState* play) { void func_808B8EE0(BgSpot18Obj* this) { this->actionFunc = func_808B8F08; - this->dyna.actor.world.rot.y = 0; this->dyna.actor.speed = 0.0f; - this->dyna.actor.velocity.z = 0.0f; - this->dyna.actor.velocity.y = 0.0f; - this->dyna.actor.velocity.x = 0.0f; + this->dyna.actor.velocity.x = this->dyna.actor.velocity.y = this->dyna.actor.velocity.z = 0.0f; + this->dyna.actor.world.rot.y = 0; } void func_808B8F08(BgSpot18Obj* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 706cbdee06..0b32afe5ee 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -171,10 +171,10 @@ void BgYdanHasi_Update(Actor* thisx, PlayState* play) { void BgYdanHasi_Draw(Actor* thisx, PlayState* play) { static Gfx* dLists[] = { gDTSlidingPlatformDL, gDTWaterPlaneDL, gDTRisingPlatformsDL }; - BgYdanHasi* this = (BgYdanHasi*)thisx; + s16 params = thisx->params; - if (this->dyna.actor.params == HASI_WATER_BLOCK || this->dyna.actor.params == HASI_THREE_BLOCKS) { - Gfx_DrawDListOpa(play, dLists[this->dyna.actor.params]); + if (params == HASI_WATER_BLOCK || params == HASI_THREE_BLOCKS) { + Gfx_DrawDListOpa(play, dLists[params]); } else { OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_hasi.c", 577); diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index 03114d1627..5441cae92f 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -417,6 +417,9 @@ void BgYdanSp_Draw(Actor* thisx, PlayState* play) { MtxF mtxF; OPEN_DISPS(play->state.gfxCtx, "../z_bg_ydan_sp.c", 781); + + if (1) {} + Gfx_SetupDL_25Xlu(play->state.gfxCtx); if (thisx->params == WEB_WALL) { gSPMatrix(POLY_XLU_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_ydan_sp.c", 787),