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();