draw non widescreen anim vote bg before falling back to vanilla bg

how it was before, the game just fallback to the vanila widescreen patch if there was no animated widescreen bg provided, just fall back to the non widescreen anim patch instead if it exists
This commit is contained in:
Alug committed 2025-01-26 16:18:16 +01:00
1 parent b7345107d7
commit 6d671b6576
1 file changed
+22 -26
+22 -26
View File
@@ -300,7 +300,7 @@ static void Y_AnimatedVoteScreenCheck(void)
strncpy(tmpPrefix, luaVoteScreen, 4);
else
{
if(G_BattleGametype())
if (G_BattleGametype())
strcpy(tmpPrefix, "BTLS");
}
@@ -919,20 +919,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(?)
@@ -969,23 +961,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...