From a29d9e157c6cba36c35cec2d0f9149bd3e3e7fa2 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Thu, 7 Dec 2017 03:01:57 -0500 Subject: [PATCH] - fixed: screen->FrameTime should use an adjusted frame start time --- src/d_main.cpp | 2 +- src/i_time.cpp | 5 +++++ src/i_time.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 9d8055b0d..6247a5339 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -781,7 +781,7 @@ void D_Display () { - screen->FrameTime = I_msTime(); + screen->FrameTime = I_msTimeFS(); TexMan.UpdateAnimations(screen->FrameTime); R_UpdateSky(screen->FrameTime); switch (gamestate) diff --git a/src/i_time.cpp b/src/i_time.cpp index 0511a79f0..bd8a3817a 100644 --- a/src/i_time.cpp +++ b/src/i_time.cpp @@ -164,6 +164,11 @@ uint64_t I_msTime() return NSToMS(I_nsTime()); } +uint64_t I_msTimeFS() // from "start" +{ + return NSToMS(I_nsTime() - FirstFrameStartTime); +} + int I_GetTime() { return NSToTic(CurrentFrameStartTime - FirstFrameStartTime); diff --git a/src/i_time.h b/src/i_time.h index 33907ded2..63c4586f1 100644 --- a/src/i_time.h +++ b/src/i_time.h @@ -22,5 +22,8 @@ void I_FreezeTime(bool frozen); // [RH] Returns millisecond-accurate time uint64_t I_msTime(); +// [SP] Returns millisecond-accurate time from start +uint64_t I_msTimeFS(); + // Nanosecond-accurate time uint64_t I_nsTime();