From 1b124bc27fa6be7bd90bb61f12c8b460ab33e093 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 30 Mar 2024 15:08:19 -0700 Subject: [PATCH] Colorize minimap finish line --- src/k_hud.cpp | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/src/k_hud.cpp b/src/k_hud.cpp index a02b24c03..887fd2fdb 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -4307,6 +4307,8 @@ static void K_drawKartMinimap(void) boolean doprogressionbar = false; boolean dofade = false, doencore = false; + UINT8 minipal; + // Draw the HUD only when playing in a level. // hu_stuff needs this, unlike st_stuff. if (gamestate != GS_LEVEL) @@ -4378,22 +4380,45 @@ static void K_drawKartMinimap(void) minimaptrans = ((10-minimaptrans)<= numlaps) // Final lap + minipal = K_RainbowColor(leveltime); + else // Standard: color to leader + minipal = players[bestplayer].skincolor; + if (doencore) { - V_DrawScaledPatch( - x + (SHORT(workingPic->width)/2), - y - (SHORT(workingPic->height)/2), + V_DrawFixedPatch( + (x + (SHORT(workingPic->width)/2))*FRACUNIT, + (y - (SHORT(workingPic->height)/2))*FRACUNIT, + FRACUNIT, splitflags|minimaptrans|V_FLIP, - workingPic + workingPic, + R_GetTranslationColormap(TC_DEFAULT, static_cast(minipal), GTC_CACHE) ); } else { - V_DrawScaledPatch( - x - (SHORT(workingPic->width)/2), - y - (SHORT(workingPic->height)/2), + V_DrawFixedPatch( + (x - (SHORT(workingPic->width)/2))*FRACUNIT, + (y - (SHORT(workingPic->height)/2))*FRACUNIT, + FRACUNIT, splitflags|minimaptrans, - workingPic + workingPic, + R_GetTranslationColormap(TC_DEFAULT, static_cast(minipal), GTC_CACHE) ); }