Merge branch 'master' of github.com:fabiangreffrath/woof

This commit is contained in:
Fabian Greffrath 2024-05-07 11:04:38 +02:00
commit 323674e18d

View File

@ -34,6 +34,7 @@ HANDLE hTimer = NULL;
#endif
static uint64_t basecounter = 0;
static uint64_t basecounter_scaled = 0;
static uint64_t basefreq = 0;
static int MSToTic(uint32_t time)
@ -78,12 +79,12 @@ static uint64_t GetPerfCounter_Scaled(void)
counter = SDL_GetPerformanceCounter() * time_scale / 100;
if (basecounter == 0)
if (basecounter_scaled == 0)
{
basecounter = counter;
basecounter_scaled = counter;
}
return counter - basecounter;
return counter - basecounter_scaled;
}
static uint32_t GetTimeMS_Scaled(void)
@ -92,12 +93,12 @@ static uint32_t GetTimeMS_Scaled(void)
counter = SDL_GetPerformanceCounter() * time_scale / 100;
if (basecounter == 0)
if (basecounter_scaled == 0)
{
basecounter = counter;
basecounter_scaled = counter;
}
return ((counter - basecounter) * 1000ull) / basefreq;
return ((counter - basecounter_scaled) * 1000ull) / basefreq;
}
int I_GetTime_RealTime(void)
@ -170,7 +171,7 @@ void I_SetTimeScale(int scale)
time_scale = scale;
basecounter += (GetPerfCounter_Scaled() - counter);
basecounter_scaled += (GetPerfCounter_Scaled() - counter);
}
void I_SetFastdemoTimer(boolean on)
@ -188,7 +189,7 @@ void I_SetFastdemoTimer(boolean on)
counter = TicToCounter(I_GetTime_FastDemo());
basecounter += (GetPerfCounter_Scaled() - counter);
basecounter_scaled += (GetPerfCounter_Scaled() - counter);
I_GetTime = I_GetTime_Scaled;
I_GetFracTime = I_GetFracTime_Scaled;