M_DrawChallengeTile: The non-category size of SECRET_MAP will now show a "map face", ala Map Anger/menu Round Queue

This commit is contained in:
toaster 2025-08-14 21:52:27 +01:00
parent ee76f539e9
commit d98b88a61f
5 changed files with 97 additions and 45 deletions

View file

@ -1526,7 +1526,7 @@ static void K_initKartHUD(void)
} }
} }
void K_DrawMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, UINT16 map, const UINT8 *colormap) void K_DrawMapThumbnail2(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, UINT16 map, const UINT8 *colormap, fixed_t accordion)
{ {
patch_t *PictureOfLevel = NULL; patch_t *PictureOfLevel = NULL;
@ -1543,58 +1543,72 @@ void K_DrawMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, UINT1
PictureOfLevel = static_cast<patch_t*>(mapheaderinfo[map]->thumbnailPic); PictureOfLevel = static_cast<patch_t*>(mapheaderinfo[map]->thumbnailPic);
} }
K_DrawLikeMapThumbnail(x, y, width, flags, PictureOfLevel, colormap); K_DrawLikeMapThumbnail(x, y, width, flags, PictureOfLevel, colormap, accordion);
} }
void K_DrawLikeMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, patch_t *patch, const UINT8 *colormap) void K_DrawLikeMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, patch_t *patch, const UINT8 *colormap, fixed_t accordion)
{ {
if (flags & V_FLIP) fixed_t scale = FixedDiv(width, (320 << FRACBITS));
x += width;
V_DrawFixedPatch( if (flags & V_FLIP)
x += FixedMul(width, accordion);
V_DrawStretchyFixedPatch(
x, y, x, y,
FixedDiv(width, (320 << FRACBITS)), FixedMul(scale, accordion),
scale,
flags, flags,
patch, patch,
colormap colormap
); );
} }
void K_DrawMapAsFace(INT32 x, INT32 y, UINT32 flags, UINT16 map, const UINT8 *colormap) void K_DrawMapAsFace(INT32 x, INT32 y, UINT32 flags, UINT16 map, const UINT8 *colormap, fixed_t accordion, INT32 unit)
{ {
const fixed_t iconHeight = (14 << FRACBITS); const fixed_t iconHeight = (14 * unit) << FRACBITS;
const fixed_t iconWidth = (iconHeight * 320) / 200; const fixed_t iconWidth = (iconHeight * 320) / 200;
INT32 unit = 1;
fixed_t mul = FRACUNIT; fixed_t mul = FRACUNIT;
if (flags & V_NOSCALESTART) if (flags & V_NOSCALESTART)
{ {
unit = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy); unit *= (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
mul = 1; mul = 1;
} }
INT32 hunit = (unit * accordion);
V_DrawFill( V_DrawFill(
x, x,
y, y,
16 * unit, (16 * hunit)/FRACUNIT,
16 * unit, 16 * unit,
(flags & ~V_FLIP) (flags & ~V_FLIP)
); );
if (flags & V_NOSCALESTART)
{
hunit /= FRACUNIT;
}
else
{
hunit = FixedMul(hunit, mul);
}
V_SetClipRect( V_SetClipRect(
(x + unit) * mul, (x * mul) + hunit,
(y + unit) * mul, (y + unit) * mul,
(14 * unit) * mul, (14 * hunit),
(14 * unit) * mul, (14 * unit) * mul,
(flags & ~V_FLIP) (flags & ~V_FLIP)
); );
K_DrawMapThumbnail( K_DrawMapThumbnail2(
((x + unit) * FRACUNIT) - (iconWidth - iconHeight)/2, (x * FRACUNIT) + hunit - FixedMul(iconWidth - iconHeight, accordion)/2,
((y + unit) * FRACUNIT), ((y + unit) * FRACUNIT),
iconWidth, iconWidth,
flags, flags,
map, map,
colormap colormap,
accordion
); );
V_ClearClipRect(); V_ClearClipRect();

View file

@ -58,9 +58,10 @@ INT32 K_drawKartMicroTime(const char *todrawtext, INT32 workx, INT32 worky, INT3
void K_drawKart2PTimestamp(void); void K_drawKart2PTimestamp(void);
void K_drawKart4PTimestamp(void); void K_drawKart4PTimestamp(void);
void K_drawEmeraldWin(boolean overlay); void K_drawEmeraldWin(boolean overlay);
void K_DrawMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, UINT16 map, const UINT8 *colormap); void K_DrawMapThumbnail2(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, UINT16 map, const UINT8 *colormap, fixed_t accordion);
void K_DrawLikeMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, patch_t *patch, const UINT8 *colormap); #define K_DrawMapThumbnail(x, y, w, f, m, c) K_DrawMapThumbnail2(x, y, w, f, m, c, FRACUNIT)
void K_DrawMapAsFace(INT32 x, INT32 y, UINT32 flags, UINT16 map, const UINT8 *colormap); void K_DrawLikeMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, patch_t *patch, const UINT8 *colormap, fixed_t accordion);
void K_DrawMapAsFace(INT32 x, INT32 y, UINT32 flags, UINT16 map, const UINT8 *colormap, fixed_t accordion, INT32 unit);
void K_drawTargetHUD(const vector3_t *origin, player_t *player); void K_drawTargetHUD(const vector3_t *origin, player_t *player);
void K_drawButton(fixed_t x, fixed_t y, INT32 flags, patch_t *button[2], boolean pressed); void K_drawButton(fixed_t x, fixed_t y, INT32 flags, patch_t *button[2], boolean pressed);
void K_drawButtonAnim(INT32 x, INT32 y, INT32 flags, patch_t *button[2], tic_t animtic); void K_drawButtonAnim(INT32 x, INT32 y, INT32 flags, patch_t *button[2], tic_t animtic);

View file

@ -6933,8 +6933,42 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, UINT8 *flash
} }
case SECRET_MAP: case SECRET_MAP:
iconid = 14; {
UINT16 mapnum = M_UnlockableMapNum(ref);
if (mapnum < nummapheaders && mapheaderinfo[mapnum]
&& (
( // Check for visitation
(mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
|| (mapheaderinfo[mapnum]->records.mapvisited & MV_VISITED)
) && ( // Check for completion
!(mapheaderinfo[mapnum]->menuflags & LF2_FINISHNEEDED)
|| (mapheaderinfo[mapnum]->records.mapvisited & MV_BEATEN)
)
))
{
if (ref->majorunlock)
{
K_DrawMapAsFace(
(x + 5) + (32*(FRACUNIT-accordion))/(2*FRACUNIT), (y + 5),
tileflags,
mapnum,
NULL, accordion, 2
);
}
else
{
K_DrawMapAsFace(
(x + 2) + (16*(FRACUNIT-accordion))/(2*FRACUNIT), (y + 2),
tileflags,
mapnum,
NULL, accordion, 1
);
}
pat = NULL;
}
iconid = 0; //14; -- This one suits a little better for "go complete this level normally"
break; break;
}
case SECRET_ALTMUSIC: case SECRET_ALTMUSIC:
iconid = 16; iconid = 16;
break; break;
@ -7004,29 +7038,32 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, UINT8 *flash
} }
} }
siz = (SHORT(pat->width) << FRACBITS); if (pat)
{
siz = (SHORT(pat->width) << FRACBITS);
if (!siz) if (!siz)
; // prevent div/0 ; // prevent div/0
else if (ref->majorunlock) else if (ref->majorunlock)
{ {
V_DrawStretchyFixedPatch( V_DrawStretchyFixedPatch(
((x + 5)*FRACUNIT) + (32*(FRACUNIT-accordion)/2), (y + 5)*FRACUNIT, ((x + 5)*FRACUNIT) + (32*(FRACUNIT-accordion))/2, (y + 5)*FRACUNIT,
FixedDiv(32*accordion, siz), FixedDiv(32*accordion, siz),
FixedDiv(32 << FRACBITS, siz), FixedDiv(32 << FRACBITS, siz),
tileflags, pat, tileflags, pat,
colormap colormap
); );
} }
else else
{ {
V_DrawStretchyFixedPatch( V_DrawStretchyFixedPatch(
((x + 2)*FRACUNIT) + (16*(FRACUNIT-accordion)/2), (y + 2)*FRACUNIT, ((x + 2)*FRACUNIT) + (16*(FRACUNIT-accordion))/2, (y + 2)*FRACUNIT,
FixedDiv(16*accordion, siz), FixedDiv(16*accordion, siz),
FixedDiv(16 << FRACBITS, siz), FixedDiv(16 << FRACBITS, siz),
tileflags, pat, tileflags, pat,
colormap colormap
); );
}
} }
drawborder: drawborder:

View file

@ -705,7 +705,7 @@ static void Y_DrawVoteThumbnail(fixed_t center_x, fixed_t center_y, fixed_t widt
fy + fh - whiteSq + dupy, fy + fh - whiteSq + dupy,
flags | V_NOSCALESTART | ((encore == true) ? V_FLIP : 0), flags | V_NOSCALESTART | ((encore == true) ? V_FLIP : 0),
g_voteLevels[v][0], g_voteLevels[v][0],
NULL NULL, FRACUNIT, 1
); );
} }
} }

View file

@ -1615,7 +1615,7 @@ void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations,
x - 9, y - 13, x - 9, y - 13,
(baseflags|((menuqueue.entries[i].encore) ? V_FLIP : 0)), (baseflags|((menuqueue.entries[i].encore) ? V_FLIP : 0)),
menuqueue.entries[i].mapnum, menuqueue.entries[i].mapnum,
NULL NULL, FRACUNIT, 1
); );
x += 24; x += 24;