[renderer] Compensate for scale in cross-hair placement

I was wondering where it had gone (south east, actually).
This commit is contained in:
Bill Currie 2022-11-18 11:23:32 +09:00
parent 2a1255de59
commit ae200e4e40
3 changed files with 9 additions and 6 deletions

View file

@ -711,8 +711,9 @@ gl_Draw_Crosshair (void)
if ((unsigned) ch >= sizeof (crosshair_func) / sizeof (crosshair_func[0]))
return;
x = vid.width / 2 + cl_crossx;
y = vid.height / 2 + cl_crossy;
int s = 2 * gl_2d_scale;
x = vid.width / s + cl_crossx;
y = vid.height / s + cl_crossy;
crosshair_func[ch] (x, y);
}

View file

@ -614,9 +614,10 @@ void
glsl_Draw_Crosshair (void)
{
int x, y;
int s = 2 * glsl_2d_scale;
x = vid.width / 2 + cl_crossx;
y = vid.height / 2 + cl_crossy;
x = vid.width / s + cl_crossx;
y = vid.height / s + cl_crossy;
glsl_Draw_CrosshairAt (crosshair, x, y);
}

View file

@ -852,9 +852,10 @@ void
Vulkan_Draw_Crosshair (vulkan_ctx_t *ctx)
{
int x, y;
int s = 2 * ctx->twod_scale;
x = vid.width / 2 + cl_crossx;
y = vid.height / 2 + cl_crossy;
x = vid.width / s + cl_crossx;
y = vid.height / s + cl_crossy;
Vulkan_Draw_CrosshairAt (crosshair, x, y, ctx);
}