From 7ac57c976d95bce5a7a98e0f269e4cd3d61f3055 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sat, 5 Apr 2025 16:41:32 +0100 Subject: Pass screen width and height into HudPaint events This makes it unnecessary to call hud_screensize in basically every handler. --- src/inputhud.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/inputhud.c') diff --git a/src/inputhud.c b/src/inputhud.c index 0dd4f11..6eaa857 100644 --- a/src/inputhud.c +++ b/src/inputhud.c @@ -310,10 +310,8 @@ static const char *const fontnames[] = { }; static struct { ulong h; int sz; } fonts[countof(fontnames)]; -HANDLE_EVENT(HudPaint) { +HANDLE_EVENT(HudPaint, int screenw, int screenh) { if (!con_getvari(sst_inputhud)) return; - int screenw, screenh; - hud_screensize(&screenw, &screenh); int basesz = screenw > screenh ? screenw : screenh; int boxsz = ceilf(basesz * 0.025f); if (boxsz < 24) boxsz = 24; -- cgit v1.2.3-54-g00ecf