Wait until fully loaded before using framerate cap

This commit is contained in:
Sally Coolatta 2022-03-27 02:05:00 -04:00
parent 35b1a0d63f
commit 23b0a5fcaf

View file

@ -20,6 +20,7 @@
#include "r_plane.h" #include "r_plane.h"
#include "p_spec.h" #include "p_spec.h"
#include "r_state.h" #include "r_state.h"
#include "console.h" // con_startup_loadprogress
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" // for cv_glshearing #include "hardware/hw_main.h" // for cv_glshearing
#endif #endif
@ -51,6 +52,11 @@ consvar_t cv_fpscap = CVAR_INIT ("fpscap", "Match refresh rate", CV_SAVE, fpscap
UINT32 R_GetFramerateCap(void) UINT32 R_GetFramerateCap(void)
{ {
if (con_startup_loadprogress != LOADED_ALLDONE)
{
return 0;
}
if (cv_fpscap.value < 0) if (cv_fpscap.value < 0)
{ {
return I_GetRefreshRate(); return I_GetRefreshRate();