From 23b0a5fcaf342f97774dc7d01ecc1d4f2c294abb Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 27 Mar 2022 02:05:00 -0400 Subject: [PATCH] Wait until fully loaded before using framerate cap --- src/r_fps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/r_fps.c b/src/r_fps.c index d75ca4a30..51492bdbf 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -20,6 +20,7 @@ #include "r_plane.h" #include "p_spec.h" #include "r_state.h" +#include "console.h" // con_startup_loadprogress #ifdef HWRENDER #include "hardware/hw_main.h" // for cv_glshearing #endif @@ -51,6 +52,11 @@ 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();