From 2d8905c8160d3f5712ca9aead35ad9409aa8d994 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 9 Apr 2023 17:14:24 -0400 Subject: [PATCH] Handle Encore ruby in Y_DrawVoteThumbnail --- src/k_vote.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/k_vote.c b/src/k_vote.c index 326ac09a4..82dd24c10 100644 --- a/src/k_vote.c +++ b/src/k_vote.c @@ -361,6 +361,7 @@ void Y_SetPlayersVote(const UINT8 playerId, SINT8 newVote) static void Y_DrawVoteThumbnail(fixed_t x, fixed_t y, fixed_t width, INT32 flags, SINT8 v, boolean dim, SINT8 playerID) { + const boolean encore = vote_draw.levels[v].encore; const fixed_t height = (width * BASEVIDHEIGHT) / BASEVIDWIDTH; INT32 fx, fy, fw, fh; INT32 dupx, dupy; @@ -414,11 +415,22 @@ static void Y_DrawVoteThumbnail(fixed_t x, fixed_t y, fixed_t width, INT32 flags K_DrawMapThumbnail( x, y, - width, flags, + width, flags | ((encore == true) ? V_FLIP : 0), g_voteLevels[v][0], NULL ); + if (encore == true) + { + V_DrawFixedPatch( + x + (width / 2) - (vote_draw.ruby_icon->width * (FRACUNIT >> 1)), + y + (height / 2) - (vote_draw.ruby_icon->height * (FRACUNIT >> 1)) - (vote_draw.ruby_height << 1), + FRACUNIT, flags, + vote_draw.ruby_icon, + NULL + ); + } + if (dim == true) { V_DrawFadeFill( @@ -662,11 +674,6 @@ static void Y_DrawVoteSelection(fixed_t offset) destHop = SELECTION_HOP; } - if (vote_draw.levels[i].encore == true) - { - flags |= V_FLIP; - } - vote_draw.levels[i].hop += FixedMul( (destHop - vote_draw.levels[i].hop) / 2, renderdeltatics @@ -675,20 +682,10 @@ static void Y_DrawVoteSelection(fixed_t offset) Y_DrawVoteThumbnail( x, y - vote_draw.levels[i].hop, SELECTION_WIDTH, flags, - i, (selected == false), -1 + i, (selected == false), + -1 ); - if (vote_draw.levels[i].encore == true) - { - V_DrawFixedPatch( - x - (vote_draw.ruby_icon->width * (FRACUNIT >> 1)), - y - (vote_draw.ruby_icon->height * (FRACUNIT >> 1)) - (vote_draw.ruby_height << 1), - FRACUNIT, (flags & ~V_FLIP), - vote_draw.ruby_icon, - NULL - ); - } - x += SELECTION_SPACING_W; }