From 5df760b347f3b1a0247fa6a87145a3907721c9bc Mon Sep 17 00:00:00 2001 From: terminx Date: Wed, 22 Nov 2017 05:23:38 +0000 Subject: [PATCH] Small change to G_FPSLimit() git-svn-id: https://svn.eduke32.com/eduke32@6501 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 49ac0ef02..6c5814621 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -6051,7 +6051,7 @@ void G_MaybeAllocPlayer(int32_t pnum) int G_FPSLimit(void) { static uint64_t nextPageTicks = 0; - static int frameWaiting = 0; + static unsigned frameWaiting = 0; if (frameWaiting) { @@ -6061,18 +6061,16 @@ int G_FPSLimit(void) uint64_t const frameTicks = getu64ticks(); - if (r_maxfps == 0 || frameTicks >= nextPageTicks) + if (!r_maxfps || frameTicks >= nextPageTicks) { if (frameTicks >= nextPageTicks + g_frameDelay) nextPageTicks = frameTicks; nextPageTicks += g_frameDelay; frameWaiting++; - - return 1; } - return 0; + return frameWaiting; } // TODO: reorder (net)actor_t to eliminate slop and update assertion