diff --git a/src/d_main.c b/src/d_main.c index 6aeaf61e5..eb01edd9d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -755,6 +755,8 @@ void D_SRB2Loop(void) for (;;) { + frameEnd = I_GetFrameTime(); + if (lastwipetic) { oldentertics = lastwipetic; @@ -890,7 +892,6 @@ void D_SRB2Loop(void) LUA_Step(); // Fully completed frame made. - frameEnd = I_GetFrameTime(); if (!singletics && !dedicated) { I_FrameCapSleep(frameEnd); diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 2e1bf0c17..05386e9b5 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -2157,8 +2157,14 @@ static void UpdateElapsedTics(void) tic_t I_GetTime(void) { + float f = 0.0f; + UpdateElapsedTics(); - return (tic_t) floor(elapsed_tics); + + // This needs kept in a separate variable before converting + // to tic_t, due to stupid -Wbad-function-cast error. + f = floor(elapsed_tics); + return (tic_t)f; } float I_GetTimeFrac(void)