diff options
| author | inspectredc <78732756+inspectredc@users.noreply.github.com> | 2024-01-21 17:57:56 +0000 |
|---|---|---|
| committer | Garrett Cox <garrettjcox@gmail.com> | 2024-05-22 09:04:58 -0500 |
| commit | 745e554d3a856eca5d87cb80085c1b56e630e044 (patch) | |
| tree | ecb759aa4883d472849e8043dec3ac6a3a7901e5 /mm/src/code | |
| parent | 4e50afb407e51b973bf5ada3145e29afefe4dc54 (diff) | |
Fix Various Player Anim Checks (#89)
* Fix Player Anim Checks
* strcmp everything
* missed a couple
* use macro
* update comment
Diffstat (limited to 'mm/src/code')
| -rw-r--r-- | mm/src/code/z_player_lib.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/mm/src/code/z_player_lib.c b/mm/src/code/z_player_lib.c index 2a792d0f9..872936851 100644 --- a/mm/src/code/z_player_lib.c +++ b/mm/src/code/z_player_lib.c @@ -2164,8 +2164,8 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** if (player->transformation == PLAYER_FORM_DEKU) { EnArrow* bubble = NULL; - if (((player->skelAnime.animation == &gPlayerAnim_pn_drinkend)) || - (player->skelAnimeUpper.animation == &gPlayerAnim_pn_tamahaki) || + if (((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_drinkend))) || + (BEN_ANIM_EQUAL(player->skelAnimeUpper.animation, gPlayerAnim_pn_tamahaki)) || ((player->stateFlags3 & PLAYER_STATE3_40) && ((bubble = (EnArrow*)player->heldActor) != NULL))) { Matrix_TranslateRotateZYX(pos, rot); func_80125340(); @@ -2178,7 +2178,7 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** player->unk_AF0[0].y = 1.0f - (bubble->bubble.unk_144 * 0.01f); player->unk_AF0[0].z = 1.0f - (bubble->bubble.unk_144 * 0.04f); rot->z = bubble->bubble.unk_144 * 320.0f; - } else if (player->skelAnime.animation == &gPlayerAnim_pn_drinkend) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_drinkend)) { func_80124618(D_801C03E0, player->skelAnime.curFrame, player->unk_AF0); } else { func_80124618(D_801C03C0, player->skelAnimeUpper.curFrame, player->unk_AF0); @@ -2188,9 +2188,9 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** } } } else if (limbIndex == PLAYER_LIMB_TORSO) { - if ((player->skelAnime.animation == &gPlayerAnim_pg_gakkistart) || - (player->skelAnime.animation == &gPlayerAnim_pg_wait) || - (player->skelAnime.animation == &gPlayerAnim_pg_punchC) || + if ((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_gakkistart)) || + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_wait)) || + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_punchC)) || (player->transformation == PLAYER_FORM_ZORA)) { Matrix_TranslateRotateZYX(pos, rot); if (player->transformation == PLAYER_FORM_GORON) { @@ -2199,13 +2199,13 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx** func_80125318(pos, rot); if ((player->transformation != PLAYER_FORM_ZORA) || - (player->skelAnime.animation == &gPlayerAnim_pz_wait)) { + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_wait))) { struct_80124618* phi_a0 = - (player->skelAnime.animation == &gPlayerAnim_pz_wait) + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_wait)) ? D_801C0608 - : ((player->skelAnime.animation == &gPlayerAnim_pg_wait) + : ((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_wait)) ? D_801C0628 - : ((player->skelAnime.animation == &gPlayerAnim_pg_punchC) ? D_801C07C0 + : ((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_punchC)) ? D_801C07C0 : D_801C0460)); func_80124618(phi_a0, player->skelAnime.curFrame, player->unk_AF0); @@ -2298,7 +2298,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** *dList = leftHandDLists[sPlayerLod]; if (player->transformation == PLAYER_FORM_GORON) { - if (player->skelAnime.animation == &gPlayerAnim_pg_punchA) { + if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_punchA)) { func_80125CE0(player, D_801C0750, pos, rot); } } else if (player->transformation == PLAYER_FORM_ZORA) { @@ -2306,10 +2306,10 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** func_801242B4(player)) { *dList = gLinkZoraLeftHandOpenDL; } else { - s32 phi_a1 = (player->skelAnime.animation == &gPlayerAnim_pz_gakkistart) && + s32 phi_a1 = (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_gakkistart)) && (player->skelAnime.curFrame >= 6.0f); - if (phi_a1 || (player->skelAnime.animation == &gPlayerAnim_pz_gakkiplay)) { + if (phi_a1 || (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_gakkiplay))) { *dList = object_link_zora_DL_00E2A0; func_80125CE0(player, phi_a1 ? D_801C0538 : D_801C0560, pos, rot); } @@ -2348,7 +2348,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** } *dList = rightHandDLists[sPlayerLod]; - if (player->skelAnime.animation == &gPlayerAnim_pg_punchB) { + if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_punchB)) { func_80125CE0(player, D_801C0784, pos, rot); } } @@ -2757,19 +2757,19 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { OPEN_DISPS(play->state.gfxCtx); - if ((player->skelAnime.animation != &gPlayerAnim_pz_gakkiplay) && - (player->skelAnime.animation != &gPlayerAnim_pz_fishswim)) { - if (player->skelAnime.animation == &gPlayerAnim_pz_gakkistart) { + if ((!BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_gakkiplay)) && + (!BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_fishswim))) { + if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_gakkistart)) { func_80124618(D_801C0580, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->skelAnime.animation == &gPlayerAnim_pz_waterroll) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_waterroll)) { func_80124618(D_801C05A8, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->skelAnime.animation == &gPlayerAnim_pz_swimtowait) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_swimtowait)) { func_80124618(D_801C05D8, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->skelAnime.animation == &gPlayerAnim_pz_bladeon) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_bladeon)) { func_80124618(D_801C07F0, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->skelAnime.animation == &gPlayerAnim_pz_jumpAT) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_jumpAT)) { func_80124618(D_801C0820, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->skelAnime.animation == &gPlayerAnim_pz_jumpATend) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_jumpATend)) { func_80124618(D_801C0838, player->skelAnime.curFrame, player->unk_AF0); } else if (player->heldItemAction == PLAYER_IA_ZORA_FINS) { player->unk_AF0[0].x = 1.0f; @@ -2797,15 +2797,15 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { Matrix_Pop(); } - if (player->skelAnime.animation == &gPlayerAnim_pz_waterroll) { + if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_waterroll)) { func_80124618(D_801C05C8, player->skelAnime.curFrame, player->unk_AF0); D_801C05F0[0].unk_2.x = 50; D_801C05F0[0].unk_2.y = 50; D_801C05F0[0].unk_2.z = 50; D_801C05F0[1].unk_2 = D_801C05F0[0].unk_2; - } else if (player->skelAnime.animation == &gPlayerAnim_pz_swimtowait) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_swimtowait)) { func_80124618(D_801C05F0, player->skelAnime.curFrame, player->unk_AF0); - } else if (player->skelAnime.animation == &gPlayerAnim_pz_fishswim) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pz_fishswim)) { player->unk_AF0[0].x = (ABS_ALT(player->unk_B8A) * 0.00003f) + 0.5f; player->unk_AF0[0].y = player->unk_AF0[0].x; player->unk_AF0[0].z = player->unk_AF0[0].x; @@ -2843,19 +2843,19 @@ void func_80126BD0(PlayState* play, Player* player, s32 arg2) { s32 func_801271B0(PlayState* play, Player* player, s32 arg2) { if (player->transformation == PLAYER_FORM_DEKU) { - if (((player->skelAnime.animation == &gPlayerAnim_pn_kakku)) || - (player->skelAnime.animation == &gPlayerAnim_pn_kakkufinish) || - (player->skelAnime.animation == &gPlayerAnim_pn_rakkafinish) || - (player->skelAnime.animation == &gPlayerAnim_pn_batabata)) { + if ((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_kakku)) || + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_kakkufinish)) || + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_rakkafinish)) || + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_batabata))) { struct_80124618** sp3C = D_801C0AF4; OPEN_DISPS(play->state.gfxCtx); - if (player->skelAnime.animation == &gPlayerAnim_pn_kakkufinish) { + if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_kakkufinish)) { sp3C = D_801C0AFC; - } else if (player->skelAnime.animation == &gPlayerAnim_pn_batabata) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_batabata)) { sp3C = D_801C0B0C; - } else if (player->skelAnime.animation == &gPlayerAnim_pn_rakkafinish) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_rakkafinish)) { sp3C = D_801C0B04; } @@ -3332,11 +3332,11 @@ void Player_DrawGreatFairysMask(PlayState* play, Player* player) { } s32 func_80128640(PlayState* play, Player* player, Gfx* dlist) { - s32 temp_v1 = player->skelAnime.animation == &gPlayerAnim_cl_maskoff; + s32 temp_v1 = BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_cl_maskoff); f32 temp_f0; if (temp_v1 || - ((player->currentMask != PLAYER_MASK_NONE) && (player->skelAnime.animation == &gPlayerAnim_cl_setmask) && + ((player->currentMask != PLAYER_MASK_NONE) && (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_cl_setmask)) && (temp_f0 = player->skelAnime.curFrame - 8.0f, (temp_f0 >= 0.0f)) && (temp_f0 < 4.0f)) || (player->stateFlags2 & PLAYER_STATE2_1000000)) { s32 mask; @@ -3450,7 +3450,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G Math_Vec3f_Copy(&player->leftHandWorld.pos, sPlayerCurBodyPartPos); if ((*dList1 != NULL) && !func_801271B0(play, player, 0) && !func_80128640(play, player, *dList1) && - (player->skelAnime.animation == &gPlayerAnim_pg_punchA)) { + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_punchA))) { func_80127488(play, player, D_801C0778[(s32)player->skelAnime.curFrame]); } @@ -3551,7 +3551,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G Matrix_Pop(); CLOSE_DISPS(play->state.gfxCtx); - } else if (player->skelAnime.animation == &gPlayerAnim_pg_punchB) { + } else if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_punchB)) { func_80127488(play, player, D_801C07AC[(s32)player->skelAnime.curFrame]); } else { func_801271B0(play, player, 1); @@ -3621,10 +3621,10 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G func_80126BD0(play, player, 1); } else if (limbIndex == PLAYER_LIMB_TORSO) { if (player->transformation == PLAYER_FORM_GORON) { - s32 temp_a0 = player->skelAnime.animation == &gPlayerAnim_pg_gakkistart; - s32 temp_v1_3 = player->skelAnime.animation == &gPlayerAnim_pg_gakkiwait; + s32 temp_a0 = BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_gakkistart); + s32 temp_v1_3 = BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_gakkiwait); - if ((temp_a0 || temp_v1_3 || (player->skelAnime.animation == &gPlayerAnim_pg_gakkiplay))) { + if ((temp_a0 || temp_v1_3 || (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pg_gakkiplay)))) { static Gfx* D_801C0DF0[] = { object_link_goron_DL_010590, object_link_goron_DL_010368, object_link_goron_DL_010140, object_link_goron_DL_00FF18, object_link_goron_DL_00FCF0, @@ -3678,7 +3678,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G //! FAKE if (((*dList1 != NULL) && ((((void)0, player->currentMask)) != (((void)0, PLAYER_MASK_NONE)))) && (((player->transformation == PLAYER_FORM_HUMAN) && - ((player->skelAnime.animation != &gPlayerAnim_cl_setmask) || (player->skelAnime.curFrame >= 12.0f))) || + ((!BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_cl_setmask)) || (player->skelAnime.curFrame >= 12.0f))) || ((((player->transformation != PLAYER_FORM_HUMAN) && (player->currentMask >= PLAYER_MASK_FIERCE_DEITY)) && ((player->transformation + PLAYER_MASK_FIERCE_DEITY) != player->currentMask)) && (player->skelAnime.curFrame >= 10.0f)))) { @@ -3716,9 +3716,9 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G Matrix_Pop(); - if (((player->skelAnime.animation == &gPlayerAnim_cl_setmask) && + if (((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_cl_setmask)) && (player->skelAnime.curFrame >= 51.0f)) || - (player->skelAnime.animation == &gPlayerAnim_cl_setmaskend)) { + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_cl_setmaskend))) { maskMinusOne += 4; } } @@ -3728,7 +3728,7 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G CLOSE_DISPS(play->state.gfxCtx); } } else if (player->transformation == PLAYER_FORM_DEKU) { - if (player->skelAnime.animation == &gPlayerAnim_pn_gurd) { + if (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_gurd)) { OPEN_DISPS(play->state.gfxCtx); func_80124618(D_801C0410, player->skelAnime.curFrame, player->unk_AF0); @@ -3744,10 +3744,10 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G CLOSE_DISPS(play->state.gfxCtx); } else { - s32 temp_v1_5 = player->skelAnime.animation == &gPlayerAnim_pn_gakkistart; + s32 temp_v1_5 = BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_gakkistart); - if (temp_v1_5 || (player->skelAnime.animation == &gPlayerAnim_pn_gakkiplay) || - (player->skelAnime.animation == &gPlayerAnim_dl_kokeru)) { + if (temp_v1_5 || (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_gakkiplay)) || + (BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_dl_kokeru))) { static Gfx* D_801C0E2C[] = { object_link_nuts_DL_007A28, object_link_nuts_DL_0077D0, object_link_nuts_DL_007548, object_link_nuts_DL_007900, object_link_nuts_DL_0076A0, @@ -3856,8 +3856,8 @@ void Player_PostLimbDrawGameplay(PlayState* play, s32 limbIndex, Gfx** dList1, G Matrix_MultVec3f(&sPlayerFocusHeadLimbModelPos, &player->actor.focus.pos); Matrix_MultVec3f(&D_801C0E94, sPlayerCurBodyPartPos); - if ((player->skelAnime.animation == &gPlayerAnim_pn_drinkend) || - (player->skelAnimeUpper.animation == &gPlayerAnim_pn_tamahaki) || + if ((BEN_ANIM_EQUAL(player->skelAnime.animation, gPlayerAnim_pn_drinkend)) || + (BEN_ANIM_EQUAL(player->skelAnimeUpper.animation, gPlayerAnim_pn_tamahaki)) || ((player->stateFlags3 & PLAYER_STATE3_40) && ((spA8 = player->heldActor) != NULL))) { if (spA8 != NULL) { static Vec3f D_801C0EA0 = { 1300.0f, -400.0f, 0.0f }; |
