mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
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:
parent
ee76f539e9
commit
d98b88a61f
5 changed files with 97 additions and 45 deletions
|
|
@ -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;
|
||||
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
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)
|
||||
x += width;
|
||||
fixed_t scale = FixedDiv(width, (320 << FRACBITS));
|
||||
|
||||
V_DrawFixedPatch(
|
||||
if (flags & V_FLIP)
|
||||
x += FixedMul(width, accordion);
|
||||
|
||||
V_DrawStretchyFixedPatch(
|
||||
x, y,
|
||||
FixedDiv(width, (320 << FRACBITS)),
|
||||
FixedMul(scale, accordion),
|
||||
scale,
|
||||
flags,
|
||||
patch,
|
||||
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;
|
||||
INT32 unit = 1;
|
||||
fixed_t mul = FRACUNIT;
|
||||
if (flags & V_NOSCALESTART)
|
||||
{
|
||||
unit = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
unit *= (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
|
||||
mul = 1;
|
||||
}
|
||||
|
||||
INT32 hunit = (unit * accordion);
|
||||
|
||||
V_DrawFill(
|
||||
x,
|
||||
y,
|
||||
16 * unit,
|
||||
(16 * hunit)/FRACUNIT,
|
||||
16 * unit,
|
||||
(flags & ~V_FLIP)
|
||||
);
|
||||
|
||||
if (flags & V_NOSCALESTART)
|
||||
{
|
||||
hunit /= FRACUNIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
hunit = FixedMul(hunit, mul);
|
||||
}
|
||||
|
||||
V_SetClipRect(
|
||||
(x + unit) * mul,
|
||||
(x * mul) + hunit,
|
||||
(y + unit) * mul,
|
||||
(14 * unit) * mul,
|
||||
(14 * hunit),
|
||||
(14 * unit) * mul,
|
||||
(flags & ~V_FLIP)
|
||||
);
|
||||
|
||||
K_DrawMapThumbnail(
|
||||
((x + unit) * FRACUNIT) - (iconWidth - iconHeight)/2,
|
||||
K_DrawMapThumbnail2(
|
||||
(x * FRACUNIT) + hunit - FixedMul(iconWidth - iconHeight, accordion)/2,
|
||||
((y + unit) * FRACUNIT),
|
||||
iconWidth,
|
||||
flags,
|
||||
map,
|
||||
colormap
|
||||
colormap,
|
||||
accordion
|
||||
);
|
||||
|
||||
V_ClearClipRect();
|
||||
|
|
|
|||
|
|
@ -58,9 +58,10 @@ INT32 K_drawKartMicroTime(const char *todrawtext, INT32 workx, INT32 worky, INT3
|
|||
void K_drawKart2PTimestamp(void);
|
||||
void K_drawKart4PTimestamp(void);
|
||||
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_DrawLikeMapThumbnail(fixed_t x, fixed_t y, fixed_t width, UINT32 flags, patch_t *patch, const UINT8 *colormap);
|
||||
void K_DrawMapAsFace(INT32 x, INT32 y, 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);
|
||||
#define K_DrawMapThumbnail(x, y, w, f, m, c) K_DrawMapThumbnail2(x, y, w, f, m, c, FRACUNIT)
|
||||
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_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);
|
||||
|
|
|
|||
|
|
@ -6933,8 +6933,42 @@ static void M_DrawChallengeTile(INT16 i, INT16 j, INT32 x, INT32 y, UINT8 *flash
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
case SECRET_ALTMUSIC:
|
||||
iconid = 16;
|
||||
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)
|
||||
; // prevent div/0
|
||||
else if (ref->majorunlock)
|
||||
{
|
||||
V_DrawStretchyFixedPatch(
|
||||
((x + 5)*FRACUNIT) + (32*(FRACUNIT-accordion)/2), (y + 5)*FRACUNIT,
|
||||
FixedDiv(32*accordion, siz),
|
||||
FixedDiv(32 << FRACBITS, siz),
|
||||
tileflags, pat,
|
||||
colormap
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawStretchyFixedPatch(
|
||||
((x + 2)*FRACUNIT) + (16*(FRACUNIT-accordion)/2), (y + 2)*FRACUNIT,
|
||||
FixedDiv(16*accordion, siz),
|
||||
FixedDiv(16 << FRACBITS, siz),
|
||||
tileflags, pat,
|
||||
colormap
|
||||
);
|
||||
if (!siz)
|
||||
; // prevent div/0
|
||||
else if (ref->majorunlock)
|
||||
{
|
||||
V_DrawStretchyFixedPatch(
|
||||
((x + 5)*FRACUNIT) + (32*(FRACUNIT-accordion))/2, (y + 5)*FRACUNIT,
|
||||
FixedDiv(32*accordion, siz),
|
||||
FixedDiv(32 << FRACBITS, siz),
|
||||
tileflags, pat,
|
||||
colormap
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawStretchyFixedPatch(
|
||||
((x + 2)*FRACUNIT) + (16*(FRACUNIT-accordion))/2, (y + 2)*FRACUNIT,
|
||||
FixedDiv(16*accordion, siz),
|
||||
FixedDiv(16 << FRACBITS, siz),
|
||||
tileflags, pat,
|
||||
colormap
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
drawborder:
|
||||
|
|
|
|||
|
|
@ -705,7 +705,7 @@ static void Y_DrawVoteThumbnail(fixed_t center_x, fixed_t center_y, fixed_t widt
|
|||
fy + fh - whiteSq + dupy,
|
||||
flags | V_NOSCALESTART | ((encore == true) ? V_FLIP : 0),
|
||||
g_voteLevels[v][0],
|
||||
NULL
|
||||
NULL, FRACUNIT, 1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1615,7 +1615,7 @@ void Y_RoundQueueDrawer(y_data_t *standings, INT32 offset, boolean doanimations,
|
|||
x - 9, y - 13,
|
||||
(baseflags|((menuqueue.entries[i].encore) ? V_FLIP : 0)),
|
||||
menuqueue.entries[i].mapnum,
|
||||
NULL
|
||||
NULL, FRACUNIT, 1
|
||||
);
|
||||
|
||||
x += 24;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue