From b8a4d21ba597a06f2bfc667b7c0e5589799f3d76 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Sun, 1 Jun 2025 18:28:32 -0400 Subject: [PATCH] Intermission teamscore fixup --- src/k_hud.cpp | 33 ++++++++++++++++++++------------- src/k_hud.h | 2 +- src/y_inter.cpp | 5 +++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 2620655a5..f3d0cfe31 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -3540,7 +3540,7 @@ static tic_t scorechangecooldown = 0; // but HUD hooks run at variable timing based on your actual framerate. static tic_t teams_lastleveltime = 0; -void K_drawKartTeamScores(boolean fromintermission) +void K_drawKartTeamScores(boolean fromintermission, INT32 interoffset) { if (G_GametypeHasTeams() == false) { @@ -3563,12 +3563,6 @@ void K_drawKartTeamScores(boolean fromintermission) if (use4p) snapflags = V_SNAPTOTOP; - if (fromintermission) - { - use4p = true; - snapflags = 0; - } - flags |= snapflags; // bar stuff, relative to base @@ -3612,6 +3606,14 @@ void K_drawKartTeamScores(boolean fromintermission) faceoff = 4; } + if (fromintermission) + { + use4p = true; + snapflags = 0; + flags = 0; + basex += interoffset; + } + UINT8 allies = stplyr->team; UINT8 enemies = (allies == TEAM_ORANGE) ? TEAM_BLUE : TEAM_ORANGE; @@ -3698,9 +3700,12 @@ void K_drawKartTeamScores(boolean fromintermission) } } - // replace scores with eased scores - allyscore = easedallyscore; - enemyscore = totalscore - allyscore; + if (!fromintermission) + { + // replace scores with eased scores + allyscore = easedallyscore; + enemyscore = totalscore - allyscore; + } } teams_lastleveltime = leveltime; @@ -3756,8 +3761,8 @@ void K_drawKartTeamScores(boolean fromintermission) if (!fromintermission) { flags |= V_SNAPTOBOTTOM; + flags &= ~V_SNAPTOTOP; } - flags &= ~V_SNAPTOTOP; basey = 170; } @@ -3768,8 +3773,10 @@ void K_drawKartTeamScores(boolean fromintermission) if (!use4p) V_DrawScaledPatch(basex, basey, flags, kp_team_you); - if (V_GetHUDTranslucency(0) != 10) + /* + if (V_GetHUDTranslucency(0) != 10 || fromintermission) return; + */ V_DrawFill(basex+barx, basey+bary, enemywidth, barheight, enemyfill|flags); V_DrawFill(basex+barx+enemywidth, basey+bary, allywidth, barheight, allyfill|flags); @@ -7589,7 +7596,7 @@ void K_drawKartHUD(void) } } - K_drawKartTeamScores(false); + K_drawKartTeamScores(false, 0); if (K_InRaceDuel()) { diff --git a/src/k_hud.h b/src/k_hud.h index 24eb20458..15b1501db 100644 --- a/src/k_hud.h +++ b/src/k_hud.h @@ -164,7 +164,7 @@ position_t K_GetKartObjectPosToMinimapPos(fixed_t objx, fixed_t objy); INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment, UINT8 font, UINT32 flags); -void K_drawKartTeamScores(boolean fromintermission); +void K_drawKartTeamScores(boolean fromintermission, INT32 interoffset); #ifdef __cplusplus } // extern "C" diff --git a/src/y_inter.cpp b/src/y_inter.cpp index 508fa1b95..1f2f4c1c8 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -1928,6 +1928,9 @@ void Y_IntermissionDrawer(void) // Returns early if there's no players to draw Y_PlayerStandingsDrawer(&data, x); + if ((intertic - sorttic) < 8) + K_drawKartTeamScores(true, x); + // Draw bottom (and top) pieces skiptallydrawer: if (!LUA_HudEnabled(hud_intermissionmessages)) @@ -1949,8 +1952,6 @@ finalcounter: if ((modeattacking == ATTACKING_NONE) && demo.recording) ST_DrawSaveReplayHint(0); - K_drawKartTeamScores(true); - if (Y_CanSkipIntermission()) { const tic_t end = roundqueue.size != 0 ? 3*TICRATE : TICRATE;