mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
Improve crosshair position accuracy by rounding
This commit is contained in:
1 file changed
+10
@@ -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
|
||||
|
||||
Reference in new issue
Block a user