diff --git a/src/r_fps.c b/src/r_fps.c index 51492bdbf..bc70cfa1c 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -52,19 +52,12 @@ consvar_t cv_fpscap = CVAR_INIT ("fpscap", "Match refresh rate", CV_SAVE, fpscap UINT32 R_GetFramerateCap(void) { - if (con_startup_loadprogress != LOADED_ALLDONE) - { - return 0; - } - if (cv_fpscap.value < 0) { return I_GetRefreshRate(); } - else - { - return cv_fpscap.value; - } + + return cv_fpscap.value; } boolean R_UsingFrameInterpolation(void) diff --git a/src/screen.c b/src/screen.c index 7d27e31af..43e8ddc2d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -531,6 +531,8 @@ static double fps_samples[NUM_FPS_SAMPLES]; void SCR_CalculateFPS(void) { + static boolean init = false; + static precise_t startTime = 0; precise_t endTime = 0; @@ -540,6 +542,13 @@ void SCR_CalculateFPS(void) endTime = I_GetPreciseTime(); + if (init == false) + { + startTime = updateTime = endTime; + init = true; + return; + } + updateElapsed = I_PreciseToMicros(endTime - updateTime); if (updateElapsed >= FPS_SAMPLE_RATE) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index bd02f74d6..949d3f428 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1703,8 +1703,11 @@ void I_Sleep(void) boolean I_CheckFrameCap(void) { + static boolean init = false; + static precise_t start = 0; precise_t end; + int elapsed; UINT32 capFrames = R_GetFramerateCap(); @@ -1712,6 +1715,14 @@ boolean I_CheckFrameCap(void) end = I_GetPreciseTime(); + if (init == false) + { + // Just initialized. + start = end; + init = true; + return false; + } + if (capFrames == 0) { // We don't want to cap.