diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1beef9bd4..e28eb8447 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2200,7 +2200,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic else { I_Sleep(cv_sleep.value); - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); } return true; diff --git a/src/d_main.cpp b/src/d_main.cpp index 004ec7e3d..8833749dd 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -829,7 +829,7 @@ void D_SRB2Loop(void) // Pushing of + parameters is now done back in D_SRB2Main, not here. - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); oldentertics = I_GetTime(); // end of loading screen: CONS_Printf() will no more call FinishUpdate() @@ -877,7 +877,7 @@ void D_SRB2Loop(void) bool ranwipe = false; - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); if (lastwipetic) { diff --git a/src/d_net.c b/src/d_net.c index 22fd1ce5c..b68385f93 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -600,7 +600,7 @@ void Net_WaitAllAckReceived(UINT32 timeout) while (tictac == I_GetTime()) { I_Sleep(cv_sleep.value); - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); } tictac = I_GetTime(); HGetPacket(); diff --git a/src/f_wipe.cpp b/src/f_wipe.cpp index 6c848cda1..1d88396e0 100644 --- a/src/f_wipe.cpp +++ b/src/f_wipe.cpp @@ -507,7 +507,7 @@ void F_RunWipe(UINT8 wipemode, UINT8 wipetype, boolean drawMenu, const char *col while (!((nowtime = I_GetTime()) - lastwipetic)) { I_Sleep(cv_sleep.value); - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); } lastwipetic = nowtime; diff --git a/src/g_game.c b/src/g_game.c index b0c83dd86..29c131ae1 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1285,7 +1285,7 @@ void G_PreLevelTitleCard(void) while (!((nowtime = I_GetTime()) - lasttime)) { I_Sleep(cv_sleep.value); - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); } lasttime = nowtime; } diff --git a/src/i_time.c b/src/i_time.c index ff6454a8d..431d2a9a6 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -57,14 +57,19 @@ void I_InitializeTime(void) I_StartupTimer(); } -void I_UpdateTime(fixed_t timescale) +fixed_t I_GetTimeScale(void) +{ + return cv_timescale.value; +} + +void I_UpdateTime(void) { double ticratescaled; double elapsedseconds; tic_t realtics; // get real tics - ticratescaled = (double)TICRATE * FIXED_TO_FLOAT(timescale); + ticratescaled = (double)TICRATE * FIXED_TO_FLOAT(I_GetTimeScale()); enterprecise = I_GetPreciseTime(); elapsedseconds = (double)(enterprecise - oldenterprecise) / I_GetPrecisePrecision(); diff --git a/src/i_time.h b/src/i_time.h index 8d90c3d09..318b1dda1 100644 --- a/src/i_time.h +++ b/src/i_time.h @@ -38,7 +38,8 @@ tic_t I_GetTime(void); */ void I_InitializeTime(void); -void I_UpdateTime(fixed_t timescale); +void I_UpdateTime(void); +fixed_t I_GetTimeScale(void); /** \brief Block for at minimum the duration specified. This function makes a best effort not to oversleep, and will spinloop if sleeping would diff --git a/src/menus/main-1.c b/src/menus/main-1.c index 12f547000..9639e5ad5 100644 --- a/src/menus/main-1.c +++ b/src/menus/main-1.c @@ -134,7 +134,7 @@ void M_QuitResponse(INT32 ch) V_DrawSmallScaledPatch(0, 0, 0, W_CachePatchName("GAMEQUIT", PU_CACHE)); // Demo 3 Quit Screen Tails 06-16-2001 I_FinishUpdate(); // Update the screen with the image Tails 06-19-2001 I_Sleep(cv_sleep.value); - I_UpdateTime(cv_timescale.value); + I_UpdateTime(); } } I_Quit(); diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 532337b69..1a64b20da 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -8393,7 +8393,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) while (!((nowtime = I_GetTime()) - lastwipetic)) \ { \ I_Sleep(cv_sleep.value); \ - I_UpdateTime(cv_timescale.value); \ + I_UpdateTime(); \ } \ lastwipetic = nowtime; \ if (moviemode && rendermode == render_opengl) \ diff --git a/src/r_fps.c b/src/r_fps.c index 1418b2a22..68b100b28 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -50,7 +50,7 @@ UINT32 R_GetFramerateCap(void) boolean R_UsingFrameInterpolation(void) { - return (R_GetFramerateCap() != TICRATE || cv_timescale.value < FRACUNIT); + return (R_GetFramerateCap() != TICRATE || I_GetTimeScale() < FRACUNIT); } static viewvars_t pview_old[MAXSPLITSCREENPLAYERS];