Skip to content

Commit

Permalink
Proper fix to masks showing in first person, and apply it to hyrule w…
Browse files Browse the repository at this point in the history
…arriors enhancement
  • Loading branch information
garrettjoecox committed Jan 8, 2025
1 parent 5d514ef commit 08cabe0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mm/2s2h/Enhancements/Masks/PersistentMasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,14 @@ void UpdatePersistentMasksState() {
return;
}

if (player->transformation == PLAYER_FORM_DEKU && player->stateFlags1 & PLAYER_STATE1_100000) {
return;
// This emulates the vanilla check for if the masks should be drawn, specifically around
// z_player.c 12923 (Player_Draw)
if (player->stateFlags1 & PLAYER_STATE1_100000) {
Vec3f temp;
SkinMatrix_Vec3fMtxFMultXYZ(&gPlayState->viewProjectionMtxF, &player->actor.focus.pos, &temp);
if (temp.z < -4.0f) {
return;
}
}

OPEN_DISPS(gPlayState->state.gfxCtx);
Expand Down
10 changes: 10 additions & 0 deletions mm/2s2h/Enhancements/Modes/HyruleWarriorsStyledLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ extern const char* D_801C0B20[28];

void RegisterHyruleWarriorsStyledLink() {
COND_ID_HOOK(OnPlayerPostLimbDraw, PLAYER_LIMB_HEAD, CVAR, [](Player* player, s32 limbIndex) {
// This emulates the vanilla check for if the masks should be drawn, specifically around
// z_player.c 12923 (Player_Draw)
if (player->stateFlags1 & PLAYER_STATE1_100000) {
Vec3f temp;
SkinMatrix_Vec3fMtxFMultXYZ(&gPlayState->viewProjectionMtxF, &player->actor.focus.pos, &temp);
if (temp.z < -4.0f) {
return;
}
}

if (player->currentMask == PLAYER_MASK_NONE && player->transformation == PLAYER_FORM_HUMAN &&
INV_CONTENT(ITEM_MASK_KEATON) == ITEM_MASK_KEATON) {
OPEN_DISPS(gPlayState->state.gfxCtx);
Expand Down

0 comments on commit 08cabe0

Please sign in to comment.