From 669b42c4bb32325a3980d3b3908b23b0a360da36 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 4 Feb 2026 14:22:58 +0100 Subject: [PATCH] remove the loop condition for framelimiter this was for an older iteration where it ran the loop until it hit the target per condition, keeping like this may cause issue if the loop exits per condition instead of the return block now we return from within the loop --- src/d_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index f94496e50..07ed94d33 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -683,12 +683,14 @@ static void D_LimitFps(void) // frametarget in precise_t ticks (ex. 60fps = ~16,666,666) const precise_t frametarget = precision / framecap; - do + while (1) { // check the current time against the "time of the old frame"" curtime = I_GetPreciseTime(); elapsed = curtime - lasttime; + // done waiting! + // continue as normal if (elapsed >= frametarget) { lasttime = curtime; @@ -710,7 +712,6 @@ static void D_LimitFps(void) I_SleepDuration(9 * remaining / 10); } } - while (elapsed < frametarget); // the rest we just be waitin until we meet our frametime target }