Show waypoints on the minimap, if debugwaypoints is enabled
- Uses in level waypoint colors: - Green for player's next waypoint - Pink for shortcuts - Gray for disabled waypoints - Yellow for ego orb - Blue for ordinary waypoints - The player's next waypoint appears slightly larger
This commit is contained in:
parent
6b01a279c9
commit
85ce609374
1 changed files with 76 additions and 0 deletions
76
src/k_hud.c
76
src/k_hud.c
|
|
@ -3291,6 +3291,61 @@ static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32
|
|||
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, icon, colormap);
|
||||
}
|
||||
|
||||
static void K_drawKartMinimapDot(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, UINT8 color, UINT8 size)
|
||||
{
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
|
||||
amnumxpos = (/*FixedMul(*/objx/*, minimapinfo.zoom) - minimapinfo.offs_x*/);
|
||||
amnumypos = -(/*FixedMul(*/objy/*,, minimapinfo.zoom) - minimapinfo.offs_y*/);
|
||||
|
||||
if (encoremode)
|
||||
amnumxpos = -amnumxpos;
|
||||
|
||||
amxpos = (amnumxpos / FRACUNIT) /*+ (SHORT(minimapinfo.minimap_pic->width) / 2)*/;
|
||||
amypos = (amnumypos / FRACUNIT) /*+ (SHORT(minimapinfo.minimap_pic->height) / 2)*/;
|
||||
|
||||
if (flags & V_NOSCALESTART)
|
||||
{
|
||||
amxpos *= vid.dupx;
|
||||
amypos *= vid.dupy;
|
||||
}
|
||||
|
||||
V_DrawFill((amxpos + hudx) - (size / 2), (amypos + hudy) - (size / 2), size, size, flags | color);
|
||||
}
|
||||
|
||||
static void K_drawKartMinimapWaypoint(waypoint_t *wp, INT32 hudx, INT32 hudy, INT32 flags)
|
||||
{
|
||||
UINT8 pal = 0x95; // blue
|
||||
UINT8 size = 3;
|
||||
|
||||
if (wp == stplyr->nextwaypoint)
|
||||
{
|
||||
pal = 0x70; // green
|
||||
size = 6;
|
||||
}
|
||||
else if (K_GetWaypointIsShortcut(wp)) // shortcut
|
||||
{
|
||||
pal = 0x20; // pink
|
||||
}
|
||||
else if (!K_GetWaypointIsEnabled(wp)) // disabled
|
||||
{
|
||||
pal = 0x10; // gray
|
||||
}
|
||||
else if (wp->numnextwaypoints == 0 || wp->numprevwaypoints == 0)
|
||||
{
|
||||
pal = 0x40; // yellow
|
||||
}
|
||||
|
||||
if (!(flags & V_NOSCALESTART))
|
||||
{
|
||||
hudx *= vid.dupx;
|
||||
hudy *= vid.dupy;
|
||||
}
|
||||
|
||||
K_drawKartMinimapDot(wp->mobj->x, wp->mobj->y, hudx, hudy, flags | V_NOSCALESTART, pal, size);
|
||||
}
|
||||
|
||||
static void K_drawKartMinimap(void)
|
||||
{
|
||||
INT32 lumpnum;
|
||||
|
|
@ -3601,8 +3656,29 @@ static void K_drawKartMinimap(void)
|
|||
K_drawKartMinimapIcon(interpx, interpy, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
|
||||
}
|
||||
}
|
||||
|
||||
if (cv_kartdebugwaypoints.value != 0)
|
||||
{
|
||||
size_t idx;
|
||||
|
||||
for (idx = 0; idx < K_GetNumWaypoints(); ++idx)
|
||||
{
|
||||
waypoint_t *wp = K_GetWaypointFromIndex(idx);
|
||||
|
||||
I_Assert(wp != NULL);
|
||||
|
||||
K_drawKartMinimapWaypoint(wp, x, y, splitflags);
|
||||
}
|
||||
|
||||
if (stplyr->nextwaypoint != NULL)
|
||||
{
|
||||
// should be drawn on top of the others
|
||||
K_drawKartMinimapWaypoint(stplyr->nextwaypoint, x, y, splitflags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void K_drawKartStartCountdown(void)
|
||||
{
|
||||
INT32 pnum = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue