Nothing fucking works

This commit is contained in:
Sally Coolatta 2022-03-27 02:56:48 -04:00
parent 24f870a262
commit d00f2e0622
3 changed files with 22 additions and 9 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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.