Skip to content

Commit

Permalink
port: make crosshair sway resolution independent
Browse files Browse the repository at this point in the history
this might suck
  • Loading branch information
fgsfdsfgs committed Sep 22, 2023
1 parent ca88517 commit 8a62b88
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/game/bondmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -2029,14 +2029,15 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
x = g_Vars.currentplayer->speedtheta * 0.3f + g_Vars.currentplayer->gunextraaimx;
y = -g_Vars.currentplayer->speedverta * 0.1f + g_Vars.currentplayer->gunextraaimy;
#else
f32 scale;
f32 xscale, yscale;
if (movedata.freelookdx || movedata.freelookdy) {
scale = g_PlayerCrosshairSway * 240.f / (f32)videoGetHeight();
xscale = g_PlayerCrosshairSway * 0.20f;
yscale = g_PlayerCrosshairSway * 0.30f;
} else {
scale = g_PlayerCrosshairSway;
xscale = yscale = g_PlayerCrosshairSway;
}
x = g_Vars.currentplayer->speedtheta * 0.3f * scale + g_Vars.currentplayer->gunextraaimx;
y = -g_Vars.currentplayer->speedverta * 0.1f * scale + g_Vars.currentplayer->gunextraaimy;
x = g_Vars.currentplayer->speedtheta * 0.3f * xscale + g_Vars.currentplayer->gunextraaimx;
y = -g_Vars.currentplayer->speedverta * 0.1f * yscale + g_Vars.currentplayer->gunextraaimy;
#endif

bgunSwivelWithDamp(x, y, PAL ? 0.955f : 0.963f);
Expand Down

0 comments on commit 8a62b88

Please sign in to comment.