M_DrawChallenges: Adjust drawing order so all underlays are drawn before any actual content

Prevents reticule on bottom row getting slightly cut off
This commit is contained in:
toaster 2023-02-25 14:16:43 +00:00
parent 500e951e59
commit 6d0409e33d

View file

@ -5003,7 +5003,7 @@ static void M_DrawChallengePreview(INT32 x, INT32 y)
void M_DrawChallenges(void) void M_DrawChallenges(void)
{ {
INT32 x = currentMenu->x, explodex, selectx; INT32 x = currentMenu->x, explodex, selectx;
INT32 y = currentMenu->y; INT32 y;
INT16 i, j; INT16 i, j;
const char *str; const char *str;
INT16 offset; INT16 offset;
@ -5030,12 +5030,25 @@ void M_DrawChallenges(void)
#undef questionloop #undef questionloop
} }
// Do underlay for everything else early so the bottom of the reticule doesn't get shaded over.
{
y = 120;
V_DrawScaledPatch(0, y,
(10-challengetransparentstrength)<<V_ALPHASHIFT,
W_CachePatchName("MENUHINT", PU_CACHE));
V_DrawFadeFill(0, y+27, BASEVIDWIDTH, BASEVIDHEIGHT - (y+27), 0, 31, challengetransparentstrength);
}
if (gamedata->challengegrid == NULL || challengesmenu.extradata == NULL) if (gamedata->challengegrid == NULL || challengesmenu.extradata == NULL)
{ {
V_DrawCenteredString(x, y, V_REDMAP, "No challenges available!?"); V_DrawCenteredString(x, y, V_REDMAP, "No challenges available!?");
goto challengedesc; goto challengedesc;
} }
y = currentMenu->y;
V_DrawFadeFill(0, y-2, BASEVIDWIDTH, 90, 0, 31, challengetransparentstrength); V_DrawFadeFill(0, y-2, BASEVIDWIDTH, 90, 0, 31, challengetransparentstrength);
x -= (challengesgridstep-1); x -= (challengesgridstep-1);
@ -5122,12 +5135,6 @@ challengedesc:
{ {
y = 120; y = 120;
V_DrawScaledPatch(0, y,
(10-challengetransparentstrength)<<V_ALPHASHIFT,
W_CachePatchName("MENUHINT", PU_CACHE));
V_DrawFadeFill(0, y+27, BASEVIDWIDTH, BASEVIDHEIGHT - (y+27), 0, 31, challengetransparentstrength);
if (challengesmenu.currentunlock < MAXUNLOCKABLES) if (challengesmenu.currentunlock < MAXUNLOCKABLES)
{ {
str = unlockables[challengesmenu.currentunlock].name; str = unlockables[challengesmenu.currentunlock].name;