From c401926c0b07264d4fe0ddd4e69b0639fdc77c29 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 24 Jul 2026 15:43:50 +0200 Subject: [PATCH] fix lua hook profiler drawing out of screen bounds in some cases this omits alot of hooks in the profiler, tho not sure if anyone should even care about those back in the list maybe just have it have multiple pages like perfstats, or better just integrate it into perfstats...... --- src/lua_profile.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lua_profile.cpp b/src/lua_profile.cpp index 3c7b1c81f..bf68035b8 100644 --- a/src/lua_profile.cpp +++ b/src/lua_profile.cpp @@ -144,6 +144,7 @@ void LUA_ResetTicTimers(void) void LUA_RenderTimers(void) { constexpr int kRowHeight = 4; + float row_y = kRowHeight; // pretty much what the whole srb2::Draw does lol auto draw_row = [](float x, float y, INT32 flags, const std::string& str) @@ -156,13 +157,11 @@ void LUA_RenderTimers(void) ); }; - float row_y = kRowHeight - 60; - draw_row(0.f, row_y - kRowHeight, 0, va("-- AVERAGES PER TIC (over %d tics) --", cv_lua_profile.value)); + draw_row(0.f, 0.f, 0, va("-- AVERAGES PER TIC (over %d tics) --", cv_lua_profile.value)); if (g_invalid) { - row_y += kRowHeight; - draw_row(0.f, row_y - kRowHeight, V_GRAYMAP, " "); + draw_row(0.f, row_y, V_GRAYMAP, " "); return; } @@ -219,7 +218,7 @@ void LUA_RenderTimers(void) } } - row_y += kRowHeight * 4; // row = row.y(kRowHeight * 4) + row_y += kRowHeight * 4; } std::sort( @@ -246,7 +245,7 @@ void LUA_RenderTimers(void) key.c_str() )); - row_y += kRowHeight; // row = row.y(kRowHeight) + row_y += kRowHeight; // FIXME this is all ugly and sucks if (row_y >= BASEVIDHEIGHT)