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
This commit is contained in:
Alug committed 2026-02-04 18:05:13 +01:00
1 parent 2a658a8476
commit 669b42c4bb
1 file changed
+3 -2
+3 -2
View File
@@ -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
}