From d73bf62465f115a9cab498460e9fb527e7021ad2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 28 Aug 2020 08:25:51 +0200 Subject: [PATCH] Revert "- Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible." This reverts commit 97feb483ab1c78cc6d88b891c80e5fa481afb9a2. --- source/build/src/engine.cpp | 1 - source/core/gamecontrol.cpp | 1 + source/games/duke/src/gameloop.cpp | 3 ++- source/sw/src/game.cpp | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 01086eb35..42ce85175 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -2724,7 +2724,6 @@ void videoNextPage(void) { g_beforeSwapTime = I_msTimeF(); videoShowFrame(0); - I_SetFrameTime(); omdtims = mdtims; mdtims = I_msTime(); diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 14b69bf59..2f53733b4 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -941,6 +941,7 @@ void app_loop() TickSubsystems(); twod->SetSize(screen->GetWidth(), screen->GetHeight()); twodpsp.SetSize(screen->GetWidth(), screen->GetHeight()); + I_SetFrameTime(); handleevents(); updatePauseStatus(); diff --git a/source/games/duke/src/gameloop.cpp b/source/games/duke/src/gameloop.cpp index 1710bea81..18a79650e 100644 --- a/source/games/duke/src/gameloop.cpp +++ b/source/games/duke/src/gameloop.cpp @@ -353,6 +353,8 @@ bool GameTicker() } } + double const smoothRatio = playrunning() ? I_GetTimeFrac() * MaxSmoothRatio : MaxSmoothRatio; + gameupdatetime.Unclock(); if (ps[myconnectindex].gm & (MODE_EOL | MODE_RESTART)) @@ -368,7 +370,6 @@ bool GameTicker() drawtime.Reset(); drawtime.Clock(); S_Update(); - double const smoothRatio = playrunning() ? I_GetTimeFrac() * MaxSmoothRatio : MaxSmoothRatio; displayrooms(screenpeek, smoothRatio); displayrest(smoothRatio); drawtime.Unclock(); diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index dd9a5ba29..edf851112 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -788,11 +788,11 @@ void GameTicker(void) MoveTicker(); } + smoothratio = I_GetTimeFrac() * MaxSmoothRatio; + // Get input again to update q16ang/q16horiz. if (!PedanticMode) getinput(&loc, TRUE); - - smoothratio = I_GetTimeFrac() * MaxSmoothRatio; } drawscreen(Player + screenpeek, smoothratio);