diff --git a/src/y_inter.c b/src/y_inter.c index 61f4a069b..115967509 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -319,7 +319,7 @@ static void Y_AnimatedVoteScreenCheck(void) strncpy(tmpPrefix, luaVoteScreen, 4); else { - if(G_BattleGametype()) + if (G_BattleGametype()) strcpy(tmpPrefix, "BTLS"); } @@ -923,20 +923,12 @@ static void Y_UnloadData(void) static inline void Y_DrawAnimatedVoteScreenPatch(boolean widePatch) { char tempAnimPrefix[7]; - (widePatch) ? strcpy(tempAnimPrefix, animWidePrefix) : strcpy(tempAnimPrefix, animPrefix); - INT32 tempFoundAnimVoteFrames = (widePatch) ? foundAnimVoteWideFrames : foundAnimVoteFrames; + widePatch ? strcpy(tempAnimPrefix, animWidePrefix) : strcpy(tempAnimPrefix, animPrefix); + const INT32 tempFoundAnimVoteFrames = widePatch ? foundAnimVoteWideFrames : foundAnimVoteFrames; // Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0 - if (widePatch) - { - if (currentAnimFrame > foundAnimVoteWideFrames-1) - currentAnimFrame = 0; - } - else - { - if (currentAnimFrame > foundAnimVoteFrames-1) - currentAnimFrame = 0; - } + if (currentAnimFrame > tempFoundAnimVoteFrames - 1) + currentAnimFrame = 0; 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(?) @@ -973,23 +965,27 @@ void Y_VoteDrawer(void) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - if (widebgpatch && vid.width / vid.dupx > 320) + const boolean widescreen = (vid.width / vid.dupx > 320); + + if (foundAnimVoteWideFrames && widescreen) { - if (foundAnimVoteWideFrames == 0) - V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(widebgpatch->width)/2), - (vid.height / vid.dupy) - SHORT(widebgpatch->height), - V_SNAPTOTOP|V_SNAPTOLEFT, widebgpatch); - else - Y_DrawAnimatedVoteScreenPatch(true); + Y_DrawAnimatedVoteScreenPatch(true); + } + else if (foundAnimVoteFrames) + { + Y_DrawAnimatedVoteScreenPatch(false); + } + else if (widebgpatch && widescreen) + { + V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(widebgpatch->width)/2), + (vid.height / vid.dupy) - SHORT(widebgpatch->height), + V_SNAPTOTOP|V_SNAPTOLEFT, widebgpatch); } else { - if (foundAnimVoteFrames == 0) - V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(bgpatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) - (vid.height / vid.dupy) - SHORT(bgpatch->height), - V_SNAPTOTOP|V_SNAPTOLEFT, bgpatch); - else - Y_DrawAnimatedVoteScreenPatch(false); + V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(bgpatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?) + (vid.height / vid.dupy) - SHORT(bgpatch->height), + V_SNAPTOTOP|V_SNAPTOLEFT, bgpatch); } for (i = 0; i < 4; i++) // First, we need to figure out the height of this thing...