From b9653b4ff873e2d0afc8c5e6e33e76e96fa234d8 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 20 May 2024 17:18:06 +0200 Subject: [PATCH] unhack the animated votescreen a little also make it pause when the game is paused like it was intended originally --- src/y_inter.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 807332c9d..cc1d7dd9c 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -163,7 +163,6 @@ typedef struct static y_votelvlinfo levelinfo[5]; static y_voteclient voteclient; static INT32 votetic; -static INT32 lastvotetic; static INT32 voteendtic = -1; static patch_t *cursor = NULL; static patch_t *cursor1 = NULL; @@ -1016,11 +1015,13 @@ static inline void Y_DrawAnimatedVoteScreenPatch(boolean widePatch) currentAnimFrame = 0; } - patch_t *background = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame + 1), PU_CACHE); - V_DrawScaledPatch(160 - (background->width / 2), (200 - (background->height)), V_SNAPTOBOTTOM|V_SNAPTOTOP, background); + patch_t *background = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame + 1), PU_CACHE); + V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(background->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) + (vid.height / vid.dupy) - SHORT(background->height), + V_SNAPTOTOP|V_SNAPTOLEFT, background); - if (lastvotetic != votetic && lastvotetic % 2 == 0) - currentAnimFrame = (currentAnimFrame + 1 > tempFoundAnimVoteFrames - 1) ? 0 : currentAnimFrame + 1; // jeez no fucking idea how to make this shit not go nuts with interpolation + if (renderisnewtic && votetic % 2 == 0 && !paused) + currentAnimFrame = (currentAnimFrame + 1 > tempFoundAnimVoteFrames - 1) ? 0 : currentAnimFrame + 1; } // @@ -1287,8 +1288,6 @@ void Y_VoteDrawer(void) V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol, va("Vote ends in %d", tickdown)); } - - lastvotetic = votetic; if (renderisnewtic) {