From f54475b1f1e6e64a9a953c2df67566c17d83f3e6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 12 Nov 2017 23:39:48 +0100 Subject: [PATCH] - I_FPSTime may not return the time at frame start. This is used for real-time profiling and as such needs to return the current time or most of its uses will break. --- src/gl/utility/gl_clock.cpp | 6 +++--- src/i_time.cpp | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/gl/utility/gl_clock.cpp b/src/gl/utility/gl_clock.cpp index 5cd1daa21..a67df0234 100644 --- a/src/gl/utility/gl_clock.cpp +++ b/src/gl/utility/gl_clock.cpp @@ -226,7 +226,7 @@ void CheckBench() { // if we started the FPS counter ourselves or ran from the console // we need to wait for it to stabilize before using it. - if (waitstart > 0 && I_MSTime() < waitstart + 5000) return; + if (waitstart > 0 && I_FPSTime() - waitstart < 5000) return; FString compose; @@ -257,12 +257,12 @@ CCMD(bench) if (vid_fps == 0) { vid_fps = 1; - waitstart = I_MSTime(); + waitstart = I_FPSTime(); switchfps = true; } else { - if (ConsoleState == c_up) waitstart = I_MSTime(); + if (ConsoleState == c_up) waitstart = I_FPSTime(); switchfps = false; } C_HideConsole (); diff --git a/src/i_time.cpp b/src/i_time.cpp index 908dbdd59..6fe65ef3c 100644 --- a/src/i_time.cpp +++ b/src/i_time.cpp @@ -142,10 +142,7 @@ uint64_t I_NSTime() uint64_t I_FPSTimeNS() { - if (FreezeTime == 0) - return CurrentFrameStartTime; - else - return GetClockTimeNS(); + return GetClockTimeNS(); } unsigned int I_MSTime()