Further K_DrawMapThumbnail changes.

- Precache M_NOLVL.
- Make all width calculations relative to a lump 320 pixels wide, to make outdated map thumbnails much, MUCH more visible.
- Add K_DrawLikeMapThumbnail to draw a 320x200 patch like a map thumbnail (currently used only for RANDOMLVL).
This commit is contained in:
toaster 2022-12-14 13:08:06 +00:00
parent 19ab3a8445
commit f87db3cfab
5 changed files with 33 additions and 8 deletions

View file

@ -98,7 +98,7 @@ static char hu_tick;
//-------------------------------------------
patch_t *missingpat;
patch_t *blanklvl;
patch_t *blanklvl, *nolvl;
// song credits
static patch_t *songcreditbg;
@ -186,6 +186,7 @@ void HU_LoadGraphics(void)
Font_Load();
HU_UpdatePatch(&blanklvl, "BLANKLVL");
HU_UpdatePatch(&nolvl, "M_NOLVL");
HU_UpdatePatch(&songcreditbg, "K_SONGCR");

View file

@ -1130,7 +1130,7 @@ void K_DrawMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, UINT16 map,
if (map >= nummapheaders || !mapheaderinfo[map])
{
PictureOfLevel = W_CachePatchName("M_NOLVL", PU_CACHE);
PictureOfLevel = nolvl;
}
else if (!mapheaderinfo[map]->thumbnailPic)
{
@ -1141,14 +1141,19 @@ void K_DrawMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, UINT16 map,
PictureOfLevel = mapheaderinfo[map]->thumbnailPic;
}
K_DrawLikeMapThumbnail(x, y, width, flags, PictureOfLevel, colormap);
}
void K_DrawLikeMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, patch_t *patch, UINT8 *colormap)
{
if (flags & V_FLIP)
x += width;
V_DrawFixedPatch(
x, y,
FixedDiv(width, (SHORT(PictureOfLevel->width) << FRACBITS)),
FixedDiv(width, (320 << FRACBITS)),
flags,
PictureOfLevel,
patch,
colormap
);
}

View file

@ -39,6 +39,7 @@ void K_drawKartFreePlay(void);
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UINT8 mode);
void K_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
void K_DrawMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, UINT16 map, UINT8 *colormap);
void K_DrawLikeMapThumbnail(INT32 x, INT32 y, INT32 width, UINT32 flags, patch_t *patch, UINT8 *colormap);
extern patch_t *kp_facehighlight[8];

View file

@ -821,7 +821,7 @@ struct patch_t
};
extern patch_t *missingpat;
extern patch_t *blanklvl;
extern patch_t *blanklvl, *nolvl;
#if defined(_MSC_VER)
#pragma pack(1)

View file

@ -1074,7 +1074,13 @@ void Y_VoteDrawer(void)
if (i == 3)
{
str = "RANDOM";
V_DrawSmallScaledPatch(BASEVIDWIDTH-100, y, V_SNAPTORIGHT, randomlvl);
K_DrawLikeMapThumbnail(
(BASEVIDWIDTH-100)<<FRACBITS, (y)<<FRACBITS,
80<<FRACBITS,
V_SNAPTORIGHT|(levelinfo[i].encore ? V_FLIP : 0),
randomlvl,
NULL
);
}
else
{
@ -1110,7 +1116,13 @@ void Y_VoteDrawer(void)
{
if (i == 3)
{
V_DrawTinyScaledPatch(BASEVIDWIDTH-60, y, V_SNAPTORIGHT, randomlvl);
K_DrawLikeMapThumbnail(
(BASEVIDWIDTH-60)<<FRACBITS, (y)<<FRACBITS,
40<<FRACBITS,
V_SNAPTORIGHT|(levelinfo[i].encore ? V_FLIP : 0),
randomlvl,
NULL
);
}
else
{
@ -1159,7 +1171,13 @@ void Y_VoteDrawer(void)
if (votes[i] >= 3 && (i != pickedvote || voteendtic == -1))
{
V_DrawTinyScaledPatch(x, y, V_SNAPTOLEFT, randomlvl);
K_DrawLikeMapThumbnail(
(x)<<FRACBITS, (y)<<FRACBITS,
40<<FRACBITS,
V_SNAPTOLEFT|(levelinfo[votes[i]].encore ? V_FLIP : 0),
randomlvl,
NULL
);
}
else
{