From 64088d8f077ae4b72554961c5d0f144c0081c1ae Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 21 May 2022 12:32:40 -0500 Subject: [PATCH] Tweaks for kart v1 MR comments --- src/d_clisrv.c | 5 ----- src/i_time.c | 8 +++++++- src/m_menu.c | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 58583eea..a0476f41 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -5600,11 +5600,6 @@ boolean TryRunTics(tic_t realtics) ticking = neededtic > gametic; - if (player_joining) - { - return false; - } - if (ticking) { if (advancedemo) diff --git a/src/i_time.c b/src/i_time.c index 1e5030b7..292df0a6 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -30,6 +30,12 @@ static precise_t enterprecise, oldenterprecise; static fixed_t entertic, oldentertics; 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) { return g_time.time; @@ -90,7 +96,7 @@ void I_SleepDuration(precise_t duration) 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; } diff --git a/src/m_menu.c b/src/m_menu.c index 23653576..40b7031f 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -9144,8 +9144,7 @@ Update the maxplayers label... static fixed_t cursorframe = 0; cursorframe += renderdeltatics / 4; - if (cursorframe > 7 * FRACUNIT) - cursorframe -= 7 * FRACUNIT; + for (; cursorframe > 7 * FRACUNIT; cursorframe -= 7 * FRACUNIT) {} V_DrawFixedPatch(x<> FRACBITS) + 1), PU_CACHE), NULL); } @@ -9493,8 +9492,7 @@ static void M_DrawSetupMultiPlayerMenu(void) UINT8 *colmap; cursorframe += renderdeltatics / 4; - if (cursorframe > 7 * FRACUNIT) - cursorframe -= 7 * FRACUNIT; + for (; cursorframe > 7 * FRACUNIT; cursorframe -= 7 * FRACUNIT) {} cursor = W_CachePatchName(va("K_BHILI%d", (cursorframe >> FRACBITS) + 1), PU_CACHE); @@ -9534,9 +9532,11 @@ static void M_DrawSetupMultiPlayerMenu(void) st = multi_state->nextstate; if (st != S_NULL) multi_state = &states[st]; - multi_tics = multi_state->tics; - if (multi_tics <= -1*FRACUNIT) + + if (multi_state->tics <= -1) multi_tics += 15*FRACUNIT; + else + multi_tics += multi_state->tics * FRACUNIT; } // skin 0 is default player sprite