From d581389c9cdf5ffa7b9c7d86d2c2eb600fa8be04 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 11 May 2023 14:44:27 +0100 Subject: [PATCH] Y_PlayerStandingsDrawer: All local splitscreen players are now highlighted on the results screen - Uses function pointers to highlight display players instead in demo playback - Was previously doing this to avoid all players being highlighted in local splitscreen, but this is now relevant there too thanks to bots --- src/y_inter.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 26dd00aee..3373ce369 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -411,10 +411,6 @@ void Y_PlayerStandingsDrawer(INT32 xoffset) boolean verticalresults = (data.numplayers < 4); INT32 hilicol = highlightflags; - INT32 whiteplayer = MAXPLAYERS; - - if (!r_splitscreen) - whiteplayer = demo.playback ? displayplayers[0] : consoleplayer; patch_t *resbar = W_CachePatchName("R_RESBAR", PU_PATCH); // Results bars for players @@ -445,6 +441,12 @@ void Y_PlayerStandingsDrawer(INT32 xoffset) y = returny = 106 - (heightcount * yspacing)/2; + boolean (*_isHighlightedPlayer)(player_t *) = + (demo.playback + ? P_IsDisplayPlayer + : P_IsLocalPlayer + ); + for (i = 0; i < data.numplayers; i++) { boolean dojitter = data.jitter[data.num[i]] > 0; @@ -514,7 +516,15 @@ void Y_PlayerStandingsDrawer(INT32 xoffset) y2 += SHORT (alagles->height) + 1; }*/ - V_DrawThinString(x+27, y-2, ((data.num[i] == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime); + V_DrawThinString( + x+27, y-2, + ( + _isHighlightedPlayer(&players[data.num[i]]) + ? hilicol + : 0 + )|V_ALLOWLOWERCASE|V_6WIDTHSPACE, + strtime + ); strtime[0] = '\0';