reduce calculations in previuos commit

This commit is contained in:
Roman Fomin 2023-05-02 18:52:41 +07:00
parent 40916bd5a6
commit c53e730e36

View File

@ -1309,11 +1309,8 @@ void HU_UpdateCrosshairLock(int x, int y)
int w = (crosshair.w << hires);
int h = (crosshair.h << hires);
x += viewwindowx;
y += viewwindowy;
x = BETWEEN(viewwindowx + w, viewwindowx + viewwidth - w - 1, x);
y = BETWEEN(viewwindowy + h, viewwindowy + viewheight - h - 1, y);
x = viewwindowx + BETWEEN(w, viewwidth - w - 1, x);
y = viewwindowy + BETWEEN(h, viewheight - h - 1, y);
crosshair.x = (x >> hires) - WIDESCREENDELTA;
crosshair.y = (y >> hires);