mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Nothing fucking works
This commit is contained in:
parent
24f870a262
commit
d00f2e0622
3 changed files with 22 additions and 9 deletions
11
src/r_fps.c
11
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)
|
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();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
return cv_fpscap.value;
|
||||||
return cv_fpscap.value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean R_UsingFrameInterpolation(void)
|
boolean R_UsingFrameInterpolation(void)
|
||||||
|
|
|
||||||
|
|
@ -531,6 +531,8 @@ static double fps_samples[NUM_FPS_SAMPLES];
|
||||||
|
|
||||||
void SCR_CalculateFPS(void)
|
void SCR_CalculateFPS(void)
|
||||||
{
|
{
|
||||||
|
static boolean init = false;
|
||||||
|
|
||||||
static precise_t startTime = 0;
|
static precise_t startTime = 0;
|
||||||
precise_t endTime = 0;
|
precise_t endTime = 0;
|
||||||
|
|
||||||
|
|
@ -540,6 +542,13 @@ void SCR_CalculateFPS(void)
|
||||||
|
|
||||||
endTime = I_GetPreciseTime();
|
endTime = I_GetPreciseTime();
|
||||||
|
|
||||||
|
if (init == false)
|
||||||
|
{
|
||||||
|
startTime = updateTime = endTime;
|
||||||
|
init = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
updateElapsed = I_PreciseToMicros(endTime - updateTime);
|
updateElapsed = I_PreciseToMicros(endTime - updateTime);
|
||||||
|
|
||||||
if (updateElapsed >= FPS_SAMPLE_RATE)
|
if (updateElapsed >= FPS_SAMPLE_RATE)
|
||||||
|
|
|
||||||
|
|
@ -1703,8 +1703,11 @@ void I_Sleep(void)
|
||||||
|
|
||||||
boolean I_CheckFrameCap(void)
|
boolean I_CheckFrameCap(void)
|
||||||
{
|
{
|
||||||
|
static boolean init = false;
|
||||||
|
|
||||||
static precise_t start = 0;
|
static precise_t start = 0;
|
||||||
precise_t end;
|
precise_t end;
|
||||||
|
|
||||||
int elapsed;
|
int elapsed;
|
||||||
|
|
||||||
UINT32 capFrames = R_GetFramerateCap();
|
UINT32 capFrames = R_GetFramerateCap();
|
||||||
|
|
@ -1712,6 +1715,14 @@ boolean I_CheckFrameCap(void)
|
||||||
|
|
||||||
end = I_GetPreciseTime();
|
end = I_GetPreciseTime();
|
||||||
|
|
||||||
|
if (init == false)
|
||||||
|
{
|
||||||
|
// Just initialized.
|
||||||
|
start = end;
|
||||||
|
init = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (capFrames == 0)
|
if (capFrames == 0)
|
||||||
{
|
{
|
||||||
// We don't want to cap.
|
// We don't want to cap.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue