Fix sword scaling (#6558)

Don't apply transforms when scale 1.0, adjust translation to be gradual
This commit is contained in:
Philip Dubé
2026-05-29 02:50:02 +00:00
committed by GitHub
parent a57cdc6f77
commit d09cd4ffcd
+12 -8
View File
@@ -1316,12 +1316,14 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
if (limbIndex == PLAYER_LIMB_HEAD) {
if (CVarGetInteger(CVAR_COSMETIC("Link.HeadScale.Changed"), 0)) {
f32 scale = CVarGetFloat(CVAR_COSMETIC("Link.HeadScale.Value"), 1.0f);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
if (scale > 1.2f) {
Matrix_Translate(-((LINK_IS_ADULT ? 320.0f : 200.0f) * scale), 0.0f, 0.0f, MTXMODE_APPLY);
} else if (scale < 1.0f) {
Matrix_Translate((LINK_IS_ADULT ? 3600.0f : 2900.0f) * ABS(scale - 1.0f), 0.0f, 0.0f,
MTXMODE_APPLY);
if (scale != 1.0f) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
if (scale > 1.2f) {
Matrix_Translate(-((LINK_IS_ADULT ? 320.0f : 200.0f) * scale), 0.0f, 0.0f, MTXMODE_APPLY);
} else if (scale < 1.0f) {
Matrix_Translate((LINK_IS_ADULT ? 3600.0f : 2900.0f) * ABS(scale - 1.0f), 0.0f, 0.0f,
MTXMODE_APPLY);
}
}
}
rot->x += this->headLimbRot.z;
@@ -1330,8 +1332,10 @@ s32 Player_OverrideLimbDrawGameplayCommon(PlayState* play, s32 limbIndex, Gfx**
} else if (limbIndex == PLAYER_LIMB_L_HAND) {
if (CVarGetInteger(CVAR_COSMETIC("Link.SwordScale.Changed"), 0)) {
f32 scale = CVarGetFloat(CVAR_COSMETIC("Link.SwordScale.Value"), 1.0f);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Matrix_Translate(-((LINK_IS_ADULT ? 320.0f : 200.0f) * scale), 0.0f, 0.0f, MTXMODE_APPLY);
if (scale != 1.0f) {
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
Matrix_Translate(-((LINK_IS_ADULT ? 320.0f : 200.0f) * (scale - 1.0f)), 0.0f, 0.0f, MTXMODE_APPLY);
}
}
} else if (limbIndex == PLAYER_LIMB_UPPER) {
if (this->upperLimbYawSecondary != 0) {