summaryrefslogtreecommitdiffstats
path: root/src/core/main.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-05-29 15:50:20 +0200
committerSergeanur <s.anureev@yandex.ua>2021-06-24 20:32:44 +0200
commit2592da2273a580df7d854eecf4e0ac48a7a86162 (patch)
treea8cc1c69f2f9c84525452b910e4a56fb1521ae2e /src/core/main.cpp
parentMake times more accurate (diff)
downloadre3-2592da2273a580df7d854eecf4e0ac48a7a86162.tar
re3-2592da2273a580df7d854eecf4e0ac48a7a86162.tar.gz
re3-2592da2273a580df7d854eecf4e0ac48a7a86162.tar.bz2
re3-2592da2273a580df7d854eecf4e0ac48a7a86162.tar.lz
re3-2592da2273a580df7d854eecf4e0ac48a7a86162.tar.xz
re3-2592da2273a580df7d854eecf4e0ac48a7a86162.tar.zst
re3-2592da2273a580df7d854eecf4e0ac48a7a86162.zip
Diffstat (limited to 'src/core/main.cpp')
-rw-r--r--src/core/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 492f481e..6a773ba5 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -1177,7 +1177,10 @@ DisplayGameDebugText()
FrameSamples++;
#ifdef FIX_BUGS
- FramesPerSecondCounter += frameTime / 1000.f; // convert to seconds
+ // this is inaccurate with over 1000 fps
+ static uint32 PreviousTimeInMillisecondsPauseMode = 0;
+ FramesPerSecondCounter += (CTimer::GetTimeInMillisecondsPauseMode() - PreviousTimeInMillisecondsPauseMode) / 1000.0f; // convert to seconds
+ PreviousTimeInMillisecondsPauseMode = CTimer::GetTimeInMillisecondsPauseMode();
FramesPerSecond = FrameSamples / FramesPerSecondCounter;
#else
FramesPerSecondCounter += 1000.0f / CTimer::GetTimeStepNonClippedInMilliseconds();