0
0
Fork 0
mirror of https://git.do.srb2.org/STJr/SRB2.git synced 2025-03-09 02:41:38 +00:00

Tweaks for kart v1 MR comments

This commit is contained in:
Eidolon 2022-05-21 12:32:40 -05:00
parent 79f736b75f
commit 8040c8fe05

View file

@ -30,6 +30,12 @@ static precise_t enterprecise, oldenterprecise;
static fixed_t entertic, oldentertics; static fixed_t entertic, oldentertics;
static double tictimer; static double tictimer;
// A little more than the minimum sleep duration on Windows.
// May be incorrect for other platforms, but we don't currently have a way to
// query the scheduler granularity. SDL will do what's needed to make this as
// low as possible though.
#define MIN_SLEEP_DURATION_MS 2.1
tic_t I_GetTime(void) tic_t I_GetTime(void)
{ {
return g_time.time; return g_time.time;
@ -90,7 +96,7 @@ void I_SleepDuration(precise_t duration)
precise_t dest; precise_t dest;
{ {
double gran = round(((double)(precision / 1000) * sleepvalue * 2.1)); double gran = round(((double)(precision / 1000) * sleepvalue * MIN_SLEEP_DURATION_MS));
delaygranularity = (UINT64)gran; delaygranularity = (UINT64)gran;
} }