From a715bf63d06d72f7832dbc28d4a53629fe43469a Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Fri, 21 Oct 2022 18:57:30 -0400 Subject: [PATCH 1/2] improve matches (#1413) --- src/code/z_actor.c | 2 - src/code/z_eff_ss_dead.c | 2 - src/code/z_lights.c | 9 ++-- src/code/z_map_exp.c | 1 - src/code/z_player_lib.c | 5 +- src/code/z_scene.c | 1 - .../ovl_En_Anubice_Fire/z_en_anubice_fire.c | 2 - .../actors/ovl_En_Changer/z_en_changer.c | 22 +++----- src/overlays/actors/ovl_En_Fr/z_en_fr.c | 1 - .../ovl_En_Ganon_Mant/z_en_ganon_mant.c | 1 - src/overlays/actors/ovl_En_Go/z_en_go.c | 8 +-- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 8 +-- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 7 +-- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 2 - src/overlays/actors/ovl_En_Skb/z_en_skb.c | 14 ++--- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 1 - src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 52 ++++++++----------- src/overlays/actors/ovl_Fishing/z_fishing.c | 3 -- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 3 +- .../ovl_file_choose/z_file_choose.c | 2 - .../ovl_file_choose/z_file_nameset_PAL.c | 3 -- 21 files changed, 45 insertions(+), 104 deletions(-) diff --git a/src/code/z_actor.c b/src/code/z_actor.c index e81004620d..a6c6072434 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -5478,8 +5478,6 @@ s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3) { Actor_GetScreenPos(play, actor, &sp2C, &sp2A); - if (0) {} // Necessary to match - if ((sp2C < 0) || (sp2C > SCREEN_WIDTH) || (sp2A < 0) || (sp2A > SCREEN_HEIGHT)) { return false; } diff --git a/src/code/z_eff_ss_dead.c b/src/code/z_eff_ss_dead.c index 444712d6b7..be283f773c 100644 --- a/src/code/z_eff_ss_dead.c +++ b/src/code/z_eff_ss_dead.c @@ -104,8 +104,6 @@ void func_80026860(PlayState* play, Color_RGBA8* color, s16 arg2, s16 arg3) { POLY_XLU_DISP = displayListHead; - if (1) {} // Necessary to match - CLOSE_DISPS(play->state.gfxCtx, "../z_eff_ss_dead.c", 212); } diff --git a/src/code/z_lights.c b/src/code/z_lights.c index d0679c56f5..4d91bf4620 100644 --- a/src/code/z_lights.c +++ b/src/code/z_lights.c @@ -68,16 +68,13 @@ void Lights_Draw(Lights* lights, GraphicsContext* gfxCtx) { light = &lights->l.l[0]; while (i < lights->numLights) { - i++; - gSPLight(POLY_OPA_DISP++, light, i); + gSPLight(POLY_OPA_DISP++, light, ++i); gSPLight(POLY_XLU_DISP++, light, i); light++; } - if (0) {} - - i++; // ambient light is total number of lights + 1 - gSPLight(POLY_OPA_DISP++, &lights->l.a, i); + // ambient light is total number of lights + 1 + gSPLight(POLY_OPA_DISP++, &lights->l.a, ++i); gSPLight(POLY_XLU_DISP++, &lights->l.a, i); CLOSE_DISPS(gfxCtx, "../z_lights.c", 352); diff --git a/src/code/z_map_exp.c b/src/code/z_map_exp.c index c631cc3dcd..9820a20fd0 100644 --- a/src/code/z_map_exp.c +++ b/src/code/z_map_exp.c @@ -551,7 +551,6 @@ void Map_Update(PlayState* play) { if (R_MAP_TEX_INDEX != (R_MAP_TEX_INDEX_BASE + Map_GetFloorTextIndexOffset(mapIndex, floor))) { R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE + Map_GetFloorTextIndexOffset(mapIndex, floor); } - if (1) {} // Appears to be necessary to match if (interfaceCtx->mapRoomNum != sLastRoomNum) { // "Current floor = %d Current room = %x Number of rooms = %d" diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index 1dd2a13bc4..be8e2a40dd 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -795,11 +795,8 @@ s32 func_8008F2F8(PlayState* play) { } // Trigger general textboxes under certain conditions, like "It's so hot in here!" + triggerEntry = &sTextTriggers[var]; if (!Player_InCsMode(play)) { - triggerEntry = &sTextTriggers[var]; - - if (0) {} - if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) && (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON)) || (((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) && diff --git a/src/code/z_scene.c b/src/code/z_scene.c index 7f8598fa76..3f029ff667 100644 --- a/src/code/z_scene.c +++ b/src/code/z_scene.c @@ -148,7 +148,6 @@ void* func_800982FC(ObjectContext* objectCtx, s32 bankIndex, s16 objectId) { osSyncPrintf("OBJECT EXCHANGE NO=%2d BANK=%3d SIZE=%8.3fK\n", bankIndex, objectId, size / 1024.0f); nextPtr = (void*)ALIGN16((s32)status->segment + size); - if (1) {} // Necessary to match ASSERT(nextPtr < objectCtx->spaceEnd, "nextptr < this->endSegment", "../z_scene.c", 381); diff --git a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c index f574e52f9f..f8fce9287b 100644 --- a/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c +++ b/src/overlays/actors/ovl_En_Anubice_Fire/z_en_anubice_fire.c @@ -179,8 +179,6 @@ void EnAnubiceFire_Update(Actor* thisx, PlayState* play) { func_8002D7EC(&this->actor); this->unk_160[0] = this->actor.world.pos; - if (1) {} - for (i = 4; i >= 0; i--) { this->unk_160[i + 1] = this->unk_160[i]; } diff --git a/src/overlays/actors/ovl_En_Changer/z_en_changer.c b/src/overlays/actors/ovl_En_Changer/z_en_changer.c index 85f55f5bb6..37a81b72a5 100644 --- a/src/overlays/actors/ovl_En_Changer/z_en_changer.c +++ b/src/overlays/actors/ovl_En_Changer/z_en_changer.c @@ -73,12 +73,8 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { s16 minigameRoomNum; s16 rightChestItem; s16 leftChestItem; - s16 temp_v1_3; - s16 new_var; s32 rewardParams; - if (1) {} - minigameRoomNum = play->roomCtx.curRoom.num - 1; if (minigameRoomNum < 0) { minigameRoomNum = 0; @@ -124,27 +120,25 @@ void EnChanger_Init(Actor* thisx, PlayState* play2) { } } - temp_v1_3 = minigameRoomNum; // Set up items in chests, swap them round with probability 1/2 leftChestParams = (sLoserGetItemIds[play->roomCtx.curRoom.num] << 5) | 0x4000; - new_var = temp_v1_3; - this->leftChestNum = new_var; + this->leftChestNum = minigameRoomNum; this->leftChestGetItemId = sLoserGetItemIds[play->roomCtx.curRoom.num]; leftChestItem = sItemEtcTypes[play->roomCtx.curRoom.num]; - leftChestParams |= new_var; - rightChestParams = new_var | 0x4E21; - this->rightChestNum = new_var | 1; + leftChestParams |= minigameRoomNum; + rightChestParams = minigameRoomNum | 0x4E21; + this->rightChestNum = minigameRoomNum | 1; this->rightChestGetItemId = GI_DOOR_KEY; rightChestItem = ITEM_ETC_KEY_SMALL_CHEST_GAME; if (Rand_ZeroFloat(1.99f) < 1.0f) { rightChestParams = (sLoserGetItemIds[play->roomCtx.curRoom.num] << 5) | 0x4000; - this->rightChestNum = new_var; + this->rightChestNum = minigameRoomNum; this->rightChestGetItemId = sLoserGetItemIds[play->roomCtx.curRoom.num]; rightChestItem = sItemEtcTypes[play->roomCtx.curRoom.num]; - leftChestParams = new_var | 0x4E21; - rightChestParams |= new_var; - this->leftChestNum = temp_v1_3 | 1; + leftChestParams = minigameRoomNum | 0x4E21; + rightChestParams |= minigameRoomNum; + this->leftChestNum = minigameRoomNum | 1; this->leftChestGetItemId = GI_DOOR_KEY; leftChestItem = ITEM_ETC_KEY_SMALL_CHEST_GAME; } diff --git a/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 0720cfda95..d0f418f200 100644 --- a/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -838,7 +838,6 @@ s32 EnFr_IsFrogSongComplete(EnFr* this, PlayState* play) { if (this->ocarinaNote == (*msgCtx).lastOcarinaButtonIndex) { // required to match, possibly an array? this->ocarinaNoteIndex++; ocarinaNoteIndex = this->ocarinaNoteIndex; - if (1) {} if (ocarinaNoteIndex >= 14) { // Frog Song is completed this->ocarinaNoteIndex = 13; return true; diff --git a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c index 24c5953582..0c4fd93347 100644 --- a/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c +++ b/src/overlays/actors/ovl_En_Ganon_Mant/z_en_ganon_mant.c @@ -129,7 +129,6 @@ void EnGanonMant_Tear(EnGanonMant* this) { for (i = 0; i < count; i++) { if ((0 <= tx && tx < MANT_TEX_WIDTH) && (0 <= ty && ty < MANT_TEX_HEIGHT)) { for (areaX = 0; areaX <= tearAreaSizes[i]; areaX++) { - texIdx = 0; if (1) {} for (areaY = 0; areaY <= tearAreaSizes[i]; areaY++) { texIdx = (s16)((s16)tx + ((s16)ty * MANT_TEX_WIDTH)) + ((s16)areaX + ((s16)areaY * MANT_TEX_WIDTH)); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 421345fa4a..aa72e5cb05 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -1154,21 +1154,17 @@ void EnGo_SpawnEffectDust(EnGo* this, Vec3f* pos, Vec3f* velocity, Vec3f* accel, f32 scaleStep) { EnGoEffect* dustEffect = this->effects; s16 i; - s16 timer; for (i = 0; i < EN_GO_EFFECT_COUNT; i++, dustEffect++) { if (dustEffect->type != 1) { dustEffect->scale = scale; dustEffect->scaleStep = scaleStep; - if (1) {} - timer = initialTimer; - dustEffect->timer = timer; + dustEffect->initialTimer = dustEffect->timer = initialTimer; dustEffect->type = 1; - dustEffect->initialTimer = initialTimer; dustEffect->pos = *pos; dustEffect->accel = *accel; dustEffect->velocity = *velocity; - return; + break; } } } diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 17a772dac6..b315307e88 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -174,21 +174,17 @@ void EnGo2_SpawnEffectDust(EnGo2* this, Vec3f* pos, Vec3f* velocity, Vec3f* acce f32 scaleStep) { EnGoEffect* dustEffect = this->effects; s16 i; - s16 timer; for (i = 0; i < EN_GO2_EFFECT_COUNT; i++, dustEffect++) { if (dustEffect->type != 1) { dustEffect->scale = scale; dustEffect->scaleStep = scaleStep; - if (1) {} - timer = initialTimer; - dustEffect->timer = timer; + dustEffect->initialTimer = dustEffect->timer = initialTimer; dustEffect->type = 1; - dustEffect->initialTimer = initialTimer; dustEffect->pos = *pos; dustEffect->accel = *accel; dustEffect->velocity = *velocity; - return; + break; } } } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index bbeb6c4de0..d249f6360e 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -663,7 +663,7 @@ void func_80A75C38(EnIk* this, PlayState* play) { u8 pad; u8 pad2; u8 prevHealth; - s32 temp_v0_3; + s32 pad3; Vec3f sp38; if ((this->unk_2F8 == 3) || (this->unk_2F8 == 2)) { @@ -684,12 +684,9 @@ void func_80A75C38(EnIk* this, PlayState* play) { sp38 = this->actor.world.pos; sp38.y += 50.0f; Actor_SetDropFlag(&this->actor, &this->bodyCollider.info, true); - temp_v0_3 = this->actor.colChkInfo.damageEffect; - this->unk_2FD = temp_v0_3 & 0xFF; + this->unk_2FD = this->actor.colChkInfo.damageEffect; this->bodyCollider.base.acFlags &= ~AC_HIT; - if (1) {} - if ((this->unk_2FD == 0) || (this->unk_2FD == 0xD) || ((this->unk_2FB == 0) && (this->unk_2FD == 0xE))) { if (this->unk_2FD != 0) { CollisionCheck_SpawnShieldParticlesMetal(play, &sp38); diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 96d3f0f575..013be6445a 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -284,8 +284,6 @@ void EnKarebaba_Spin(EnKarebaba* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); if (Animation_OnFrame(&this->skelAnime, 0.0f) || Animation_OnFrame(&this->skelAnime, 12.0f)) { - if (1) {} // Here for matching purposes only. - Audio_PlayActorSfx2(&this->actor, NA_SE_EN_DEKU_JR_MOUTH); } diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 73877c16c1..27f36c86fd 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -155,8 +155,6 @@ static InitChainEntry sInitChain[] = { void EnSkb_Init(Actor* thisx, PlayState* play) { EnSkb* this = (EnSkb*)thisx; - s16 armOffset; - s16 bodyOffset; Actor_ProcessInitChain(&this->actor, sInitChain); this->actor.colChkInfo.damageTable = &sDamageTable; @@ -173,13 +171,11 @@ void EnSkb_Init(Actor* thisx, PlayState* play) { Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItem); Actor_SetScale(&this->actor, ((this->actor.params * 0.1f) + 1.0f) * 0.01f); - armOffset = this->actor.params + 0xA; - this->collider.elements[0].dim.worldSphere.radius = armOffset; - this->collider.elements[0].dim.modelSphere.radius = armOffset; - if (1) {}; - bodyOffset = (this->actor.params * 2) + 0x14; - this->collider.elements[1].dim.worldSphere.radius = bodyOffset; - this->collider.elements[1].dim.modelSphere.radius = bodyOffset; + this->collider.elements[0].dim.modelSphere.radius = this->collider.elements[0].dim.worldSphere.radius = + 10 + this->actor.params; + this->collider.elements[1].dim.modelSphere.radius = this->collider.elements[1].dim.worldSphere.radius = + 20 + (this->actor.params * 2); + this->actor.home.pos = this->actor.world.pos; this->actor.floorHeight = this->actor.world.pos.y; EnSkb_SetupRiseFromGround(this); diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index bb073fa884..9ee12db405 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -2249,7 +2249,6 @@ static Gfx D_80B4A2F8[] = { void EnZf_Draw(Actor* thisx, PlayState* play) { s32 pad; EnZf* this = (EnZf*)thisx; - ; // Extra ";" required for matching. Cannot be if (1) {} or the like. Typo? OPEN_DISPS(play->state.gfxCtx, "../z_en_zf.c", 3533); diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index e67820f3a8..f252c6b21d 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -50,20 +50,6 @@ static Vec3f D_80B5A46C = { 0.0f, 0.0f, 0.0f }; static Vec3f D_80B5A478 = { 0.0f, 10.0f, 0.0f }; -static f32 D_80B5A484 = 0.0f; - -static Vec3f D_80B5A488 = { 0.0f, 0.0f, 0.0f }; - -static s32 D_80B5A494 = -1; - -static Vec3f D_80B5A498 = { 148.0f, 260.0f, -87.0f }; - -static Vec3f D_80B5A4A4 = { -12.0f, 260.0f, -147.0f }; - -static Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; - -static u32 D_80B5A4BC = 0; - void func_80B533B0(Actor* thisx, PlayState* play) { EnZl3* this = (EnZl3*)thisx; @@ -254,7 +240,7 @@ void func_80B53980(EnZl3* thisx, s16 y, s32 idx) { curFrame = skelAnime->curFrame; unk_3DC = this->unk_3DC; yTemp = (s32)((curFrame / unk_3DC) * -11000) + y; - if (0) {}; + if (temp28C >= yTemp) { temp28C = yTemp; if (temp25C > 0) { @@ -831,15 +817,13 @@ void func_80B550F0(EnZl3* this) { } void func_80B55144(EnZl3* this) { - f32* fl = &D_80B5A484; + static f32 D_80B5A484 = 0.0f; - if (1) {} // necessary to match - - if (*fl < 2.0f) { - *fl += 1.0f; + if (D_80B5A484 < 2.0f) { + D_80B5A484 += 1.0f; EnZl3_setEyeIndex(this, 2); - } else if (*fl < 4.0f) { - *fl += 1.0f; + } else if (D_80B5A484 < 4.0f) { + D_80B5A484 += 1.0f; EnZl3_setEyeIndex(this, 1); } else { EnZl3_UpdateEyes(this); @@ -1016,6 +1000,8 @@ void func_80B55808(EnZl3* this) { func_80078914(&this->actor.projectedPos, NA_SE_VO_Z1_PAIN); } +static Vec3f D_80B5A488 = { 0.0f, 0.0f, 0.0f }; + void func_80B5582C(EnZl3* this) { Audio_PlaySfxRandom(&D_80B5A488, NA_SE_VO_Z1_CRY_0, NA_SE_VO_Z1_CRY_1 - NA_SE_VO_Z1_CRY_0 + 1); } @@ -1295,15 +1281,13 @@ void func_80B56474(EnZl3* this, s32 arg1) { } void func_80B564A8(EnZl3* this, PlayState* play) { - s32 temp_v0; - s32* val = &D_80B5A494; + static s32 D_80B5A494 = -1; + s32 temp_v0 = func_80B5396C(this); - temp_v0 = func_80B5396C(this); - - if (*val > 0) { - *val -= 1; - } else if (*val == 0) { - *val -= 1; + if (D_80B5A494 > 0) { + D_80B5A494--; + } else if (D_80B5A494 == 0) { + D_80B5A494--; if (temp_v0 == 8) { func_80B5604C(this); } @@ -1339,7 +1323,7 @@ void func_80B564A8(EnZl3* this, PlayState* play) { func_80B55EF0(this); break; case 8: - *val = 10; + D_80B5A494 = 10; break; case 9: func_80B56160(this); @@ -1831,6 +1815,10 @@ void func_80B577BC(PlayState* play, Vec3f* vec) { RAD_TO_BINANG(Math_FAtan2F(playerPos->x - posX, playerPos->z - posZ)), 0, 5); } +static Vec3f D_80B5A498 = { 148.0f, 260.0f, -87.0f }; +static Vec3f D_80B5A4A4 = { -12.0f, 260.0f, -147.0f }; +static Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; + void func_80B57858(PlayState* play) { func_80B577BC(play, &D_80B5A498); func_80B577BC(play, &D_80B5A4A4); @@ -2109,6 +2097,8 @@ void func_80B582C8(EnZl3* this, PlayState* play) { } } +static u32 D_80B5A4BC = 0; + void func_80B584B4(EnZl3* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); diff --git a/src/overlays/actors/ovl_Fishing/z_fishing.c b/src/overlays/actors/ovl_Fishing/z_fishing.c index a90b22a57d..cb252898d7 100644 --- a/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -3568,7 +3568,6 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { if (D_80B7E124 == 0) { if ((D_80B7FEA0 < 20) && ((D_80B7E0AE & 3) == 0)) { D_80B7FEA0++; - if (1) {} } } @@ -4068,8 +4067,6 @@ void Fishing_UpdateFish(Actor* thisx, PlayState* play2) { this->actor.world.pos.y += (this->unk_184 * 1.5f); - if (1) {} - if (this->unk_152 != 0) { this->unk_168 = this->unk_154; this->unk_152--; diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 5240403a51..cfe8bc115d 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -534,7 +534,7 @@ s32 MirRay_CheckInFrustum(Vec3f* vecA, Vec3f* vecB, f32 pointx, f32 pointy, f32 vecdiff.x = vecB->x - vecA->x; vecdiff.y = vecB->y - vecA->y; vecdiff.z = vecB->z - vecA->z; - if (1) {} + dist = SQ(vecdiff.x) + SQ(vecdiff.y) + SQ(vecdiff.z); if (dist == 0.0f) { @@ -555,7 +555,6 @@ s32 MirRay_CheckInFrustum(Vec3f* vecA, Vec3f* vecB, f32 pointx, f32 pointy, f32 // If the Point is within the bounding double cone, check if it is in the frustum by checking whether it is between // the bounding planes if ((SQ(closestPtx - pointx) + SQ(closestPty - pointy) + SQ(closestPtz - pointz)) <= SQ(coneRadius)) { - if (1) {} // Stores the vector difference again Math_Vec3f_Diff(vecB, vecA, &sp5C); diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index f9f103731d..8a6639ba77 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -806,8 +806,6 @@ void FileSelect_DrawFileInfo(GameState* thisx, s16 fileIndex, s16 isActive) { s16 j; s16 deathCountSplit[3]; - if (1) {} - OPEN_DISPS(this->state.gfxCtx, "../z_file_choose.c", 1709); gDPPipeSync(POLY_OPA_DISP++); diff --git a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 36f385a2ec..5d62e2ebbd 100644 --- a/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -116,9 +116,6 @@ void FileSelect_SetNameEntryVtx(GameState* thisx) { u8 temp; s16 phi_v0; - if (1) {} - if (1) {} - OPEN_DISPS(this->state.gfxCtx, "../z_file_nameset_PAL.c", 205); gDPPipeSync(POLY_OPA_DISP++); From 2cb423d9ec62072f9ba2d360a3efddbab85d0f16 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Fri, 21 Oct 2022 16:57:49 -0700 Subject: [PATCH 2/2] Document object_os (#1414) --- assets/xml/objects/object_os.xml | 71 ++++++++++--------- src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c | 4 +- src/overlays/actors/ovl_En_Ossan/z_en_ossan.c | 18 +++-- 3 files changed, 53 insertions(+), 40 deletions(-) diff --git a/assets/xml/objects/object_os.xml b/assets/xml/objects/object_os.xml index 7c3029443c..d98b3a0f52 100644 --- a/assets/xml/objects/object_os.xml +++ b/assets/xml/objects/object_os.xml @@ -1,36 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c index aedb325c26..4be5ea5242 100644 --- a/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c +++ b/src/overlays/actors/ovl_Demo_Ec/z_demo_ec.c @@ -1038,7 +1038,7 @@ void DemoEc_DrawPotionShopOwner(DemoEc* this, PlayState* play) { void DemoEc_InitMaskShopOwner(DemoEc* this, PlayState* play) { DemoEc_UseDrawObject(this, play); - DemoEc_InitSkelAnime(this, play, &object_os_Skel_004658); + DemoEc_InitSkelAnime(this, play, &gHappyMaskSalesmanSkel); DemoEc_UseAnimationObject(this, play); DemoEc_ChangeAnimation(this, &gDemoEcPotionShopOwnerAnim, 0, 0.0f, false); func_8096D5D4(this, play); @@ -1054,7 +1054,7 @@ void DemoEc_UpdateMaskShopOwner(DemoEc* this, PlayState* play) { } void DemoEc_DrawMaskShopOwner(DemoEc* this, PlayState* play) { - DemoEc_DrawSkeleton(this, play, gOsEyeClosedTex, NULL, NULL, NULL); + DemoEc_DrawSkeleton(this, play, gHappyMaskSalesmanEyeClosedTex, NULL, NULL, NULL); } void DemoEc_InitFishingOwner(DemoEc* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 1177489436..eb1c8ef358 100644 --- a/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -2023,7 +2023,7 @@ void EnOssan_InitPotionShopkeeper(EnOssan* this, PlayState* play) { } void EnOssan_InitHappyMaskShopkeeper(EnOssan* this, PlayState* play) { - SkelAnime_InitFlex(play, &this->skelAnime, &object_os_Skel_004658, &object_os_Anim_0002E4, NULL, NULL, 0); + SkelAnime_InitFlex(play, &this->skelAnime, &gHappyMaskSalesmanSkel, &gHappyMaskSalesmanIdleAnim, NULL, NULL, 0); this->actor.draw = EnOssan_DrawHappyMaskShopkeeper; this->obj3ToSeg6Func = NULL; } @@ -2454,8 +2454,11 @@ void EnOssan_DrawZoraShopkeeper(Actor* thisx, PlayState* play) { } void EnOssan_DrawPotionShopkeeper(Actor* thisx, PlayState* play) { - static void* sPotionShopkeeperEyeTextures[] = { gPotionShopkeeperEyeOpenTex, gPotionShopkeeperEyeHalfTex, - gPotionShopkeeperEyeClosedTex }; + static void* sPotionShopkeeperEyeTextures[] = { + gPotionShopkeeperEyeOpenTex, + gPotionShopkeeperEyeHalfTex, + gPotionShopkeeperEyeClosedTex, + }; EnOssan* this = (EnOssan*)thisx; s32 pad; @@ -2472,7 +2475,7 @@ void EnOssan_DrawPotionShopkeeper(Actor* thisx, PlayState* play) { } void EnOssan_DrawHappyMaskShopkeeper(Actor* thisx, PlayState* play) { - static void* sHappyMaskShopkeeperEyeTextures[] = { gOsEyeClosedTex, gOsEyeOpenTex }; + static void* sHappyMaskShopkeeperEyeTextures[] = { gHappyMaskSalesmanEyeClosedTex, gHappyMaskSalesmanEyeOpenTex }; EnOssan* this = (EnOssan*)thisx; s32 pad; @@ -2491,8 +2494,11 @@ void EnOssan_DrawHappyMaskShopkeeper(Actor* thisx, PlayState* play) { } void EnOssan_DrawBombchuShopkeeper(Actor* thisx, PlayState* play) { - static void* sBombchuShopkeeperEyeTextures[] = { gBombchuShopkeeperEyeOpenTex, gBombchuShopkeeperEyeHalfTex, - gBombchuShopkeeperEyeClosedTex }; + static void* sBombchuShopkeeperEyeTextures[] = { + gBombchuShopkeeperEyeOpenTex, + gBombchuShopkeeperEyeHalfTex, + gBombchuShopkeeperEyeClosedTex, + }; EnOssan* this = (EnOssan*)thisx; s32 pad;