diff options
author | 2025-04-05 16:41:32 +0100 | |
---|---|---|
committer | 2025-04-06 20:59:36 +0100 | |
commit | 7ac57c976d95bce5a7a98e0f269e4cd3d61f3055 (patch) | |
tree | fb31a7fa5716579dadf437ebcf799fac62634a2d /src/xhair.c | |
parent | 44eb8344a000dd315d5e21039871f353441601af (diff) | |
download | sst-7ac57c976d95bce5a7a98e0f269e4cd3d61f3055.tar.gz sst-7ac57c976d95bce5a7a98e0f269e4cd3d61f3055.zip |
Pass screen width and height into HudPaint events
This makes it unnecessary to call hud_screensize in basically
every handler.
Diffstat (limited to 'src/xhair.c')
-rw-r--r-- | src/xhair.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/xhair.c b/src/xhair.c index 1f9d1a6..1ba87f1 100644 --- a/src/xhair.c +++ b/src/xhair.c @@ -54,11 +54,9 @@ static inline void drawrect(int x0, int y0, int x1, int y1, struct rgba colour, if (outline) hud_drawrect(x0, y0, x1, y1, (struct rgba){.a = 255}, false); } -HANDLE_EVENT(HudPaint) { +HANDLE_EVENT(HudPaint, int w, int h) { if (!con_getvari(sst_xhair)) return; if (has_vtidx_IsInGame && engclient && !IsInGame(engclient)) return; - int w, h; - hud_screensize(&w, &h); int thick = con_getvari(sst_xhair_thickness); int thick1 = (thick + 1) / 2, thick2 = thick - thick1; int sz = con_getvari(sst_xhair_size); |