From dbc8e63b8b35128ad7e165f7f6fc99e2ad3f141a Mon Sep 17 00:00:00 2001 From: pogokeen Date: Tue, 21 Jan 2020 06:01:33 +0000 Subject: [PATCH] game.h: fix calc_smoothratio_demo() to take into account differences between timerGetClockRate() and TICRATE when calculating the refresh frequency to interpolate between git-svn-id: https://svn.eduke32.com/eduke32@8534 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 9735115e4..b8128bd60 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -326,7 +326,7 @@ static inline int32_t gameHandleEvents(void) static inline int32_t calc_smoothratio_demo(ClockTicks totalclk, ClockTicks ototalclk) { - int32_t rfreq = (refreshfreq != -1 ? refreshfreq : 60); + int32_t rfreq = tabledivide64((refreshfreq != -1 ? refreshfreq : 60) * TICRATE, timerGetClockRate()); uint64_t elapsedFrames = tabledivide64(((uint64_t) (totalclk - ototalclk).toScale16()) * rfreq, 65536*TICRATE); #if 0 //POGO: additional debug info for testing purposes