Challenges menu visual adjustment

* Use the new background
* Use clipped rectangles instead of black pixel overdraw, so pre-baked darkened areas in the new background can be visible instead
This commit is contained in:
toaster 2023-01-04 17:22:57 +00:00
parent 5bdbbd1695
commit f9e0c0a444

View file

@ -1926,8 +1926,6 @@ static void M_DrawCupPreview(INT16 y, levelsearch_t *levelsearch)
INT16 map, start = M_GetFirstLevelInList(&i, levelsearch);
UINT8 starti = i;
V_DrawFill(0, y, BASEVIDWIDTH, 54, 31);
if (levelsearch->cup && maxlevels > 0)
{
add = (cupgrid.previewanim / 82) % maxlevels;
@ -2060,7 +2058,9 @@ void M_DrawCupSelect(void)
templevelsearch.cup = cupgrid.builtgrid[CUPMENU_CURSORID];
V_DrawFill(0, 146 + (24*menutransition.tics), BASEVIDWIDTH, 54, 31);
M_DrawCupPreview(146 + (24*menutransition.tics), &templevelsearch);
M_DrawCupTitle(120 - (24*menutransition.tics), &templevelsearch);
}
@ -4518,7 +4518,8 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
patch_t *pat = missingpat;
UINT8 *colormap = NULL;
fixed_t siz;
UINT8 id, num, work;
UINT8 id, num;
UINT32 edgelength;
id = (i * CHALLENGEGRIDHEIGHT) + j;
num = gamedata->challengegrid[id];
@ -4526,19 +4527,19 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
// Empty spots in the grid are always unconnected.
if (num >= MAXUNLOCKABLES)
{
V_DrawFill(x, y, 16, 16, challengesbordercolor);
goto drawborder;
}
// Okay, this is what we want to draw.
ref = &unlockables[num];
edgelength = (ref->majorunlock ? 30 : 14);
// ...unless we simply aren't unlocked yet.
if ((gamedata->unlocked[num] == false)
|| (challengesmenu.pending && num == challengesmenu.currentunlock && challengesmenu.unlockanim <= UNLOCKTIME))
{
work = (ref->majorunlock) ? 2 : 1;
V_DrawFill(x, y, 16*work, 16*work,
V_DrawFill(x+1, y+1, edgelength, edgelength,
((challengesmenu.extradata[id] == CHE_HINT) ? 132 : 11));
goto drawborder;
}
@ -4589,6 +4590,12 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
siz = (SHORT(pat->width) << FRACBITS);
siz = FixedDiv(((ref->majorunlock) ? 32 : 16) << FRACBITS, siz);
V_SetClipRect(
(x+1) << FRACBITS, (y+1) << FRACBITS,
edgelength << FRACBITS, edgelength << FRACBITS,
0
);
V_DrawFixedPatch(
x*FRACUNIT, y*FRACUNIT,
siz,
@ -4596,19 +4603,11 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, boolean hili
colormap
);
V_ClearClipRect();
drawborder:
if (!hili)
{
if (ref != NULL)
{
work = 16 * (ref->majorunlock ? 2 : 1);
// Horizontal
V_DrawFill(x, y , work, 1, challengesbordercolor);
V_DrawFill(x, y + work-1, work, 1, challengesbordercolor);
// Vertical
V_DrawFill(x , y+1, 1, work-2, challengesbordercolor);
V_DrawFill(x + work-1, y+1, 1, work-2, challengesbordercolor);
}
return;
}
@ -4628,7 +4627,6 @@ static void M_DrawChallengePreview(INT32 x, INT32 y)
if (challengesmenu.currentunlock >= MAXUNLOCKABLES)
{
V_DrawFill(0, 146, BASEVIDWIDTH, 54, challengesbordercolor);
return;
}
@ -4638,13 +4636,9 @@ static void M_DrawChallengePreview(INT32 x, INT32 y)
if (!gamedata->unlocked[challengesmenu.currentunlock])
{
// todo draw some sort of question mark?
V_DrawFill(0, 146, BASEVIDWIDTH, 54, challengesbordercolor);
return;
}
if (ref->type != SECRET_CUP)
V_DrawFill(0, 146, BASEVIDWIDTH, 54, challengesbordercolor);
switch (ref->type)
{
case SECRET_SKIN:
@ -4812,7 +4806,7 @@ void M_DrawChallenges(void)
INT16 offset;
{
patch_t *bg = W_CachePatchName("M_XTRABG", PU_CACHE);
patch_t *bg = W_CachePatchName("BGUNLCK2", PU_CACHE);
V_DrawFixedPatch(0, 0, FRACUNIT, 0, bg, NULL);
}
@ -4847,15 +4841,10 @@ void M_DrawChallenges(void)
i = gamedata->challengegridwidth-1;
explodex = x - (i*16)/2;
x += (i*16)/2;
V_DrawFill(0, currentMenu->y, explodex, (CHALLENGEGRIDHEIGHT*16), challengesbordercolor);
V_DrawFill((x+16), currentMenu->y, BASEVIDWIDTH - (x+16), (CHALLENGEGRIDHEIGHT*16), challengesbordercolor);
}
selectx = explodex + (challengesmenu.hilix*16);
V_DrawFill(0, (currentMenu->y)-1 , BASEVIDWIDTH, 1, challengesbordercolor);
V_DrawFill(0, (currentMenu->y) + (CHALLENGEGRIDHEIGHT*16), BASEVIDWIDTH, 1, challengesbordercolor);
while (i >= 0 && x >= -32)
{
y = currentMenu->y-16;
@ -4910,7 +4899,6 @@ challengedesc:
// Name bar
{
y = 120;
V_DrawScaledPatch(0, y, 0, W_CachePatchName("MENUHINT", PU_CACHE));
if (challengesmenu.currentunlock < MAXUNLOCKABLES)
{