Improve crosshair position accuracy by rounding

This commit is contained in:
Matthew Coppola committed 2024-11-15 03:16:33 -05:00
1 parent 938223db28
commit bc82328353
1 file changed
+10
+10
View File
@@ -1602,6 +1602,16 @@ Gfx *sightDraw(Gfx *gdl, bool sighton, s32 sight)
return gdl;
}
#ifndef PLATFORM_N64
// Rounding the crosshair positions allow them to more accurately follow the
// gun's vector. Without this, the mantissa isn't factored in at all (cast
// to integer), which leads to some awkward behavior, such as the crosshair
// taking a long time to return to the center of the screen when coming from
// an up and/or left direction.
g_Vars.currentplayer->crosspos[0] = roundf(g_Vars.currentplayer->crosspos[0]);
g_Vars.currentplayer->crosspos[1] = roundf(g_Vars.currentplayer->crosspos[1]);
#endif
#if PAL
g_ScaleX = 1;
#else