Tweaks for kart v1 MR comments

This commit is contained in:
Eidolon 2022-05-21 12:32:40 -05:00
parent dff5fc37f1
commit 2742467f9e
2 changed files with 14 additions and 8 deletions

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;
} }

View file

@ -9145,8 +9145,7 @@ Update the maxplayers label...
static fixed_t cursorframe = 0; static fixed_t cursorframe = 0;
cursorframe += renderdeltatics / 4; cursorframe += renderdeltatics / 4;
if (cursorframe > 7 * FRACUNIT) for (; cursorframe > 7 * FRACUNIT; cursorframe -= 7 * FRACUNIT) {}
cursorframe -= 7 * FRACUNIT;
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, 0, W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE), NULL); V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, 0, W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE), NULL);
} }
@ -9537,8 +9536,7 @@ static void M_DrawSetupMultiPlayerMenu(void)
UINT8 *colmap; UINT8 *colmap;
cursorframe += renderdeltatics / 4; cursorframe += renderdeltatics / 4;
if (cursorframe > 7 * FRACUNIT) for (; cursorframe > 7 * FRACUNIT; cursorframe -= 7 * FRACUNIT) {}
cursorframe -= 7 * FRACUNIT;
cursor = W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE); cursor = W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE);
@ -9579,9 +9577,11 @@ static void M_DrawSetupMultiPlayerMenu(void)
st = multi_state->nextstate; st = multi_state->nextstate;
if (st != S_NULL) if (st != S_NULL)
multi_state = &states[st]; multi_state = &states[st];
multi_tics = multi_state->tics;
if (multi_tics == -1) if (multi_state->tics <= -1)
multi_tics = 15; multi_tics += 15*FRACUNIT;
else
multi_tics += multi_state->tics * FRACUNIT;
} }
// skin 0 is default player sprite // skin 0 is default player sprite