mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-05-30 00:56:18 -04:00
Fix sword scaling (#6558)
Don't apply transforms when scale 1.0, adjust translation to be gradual
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user