Skip to content

Commit

Permalink
Further tweaks to automap code
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 12, 2024
1 parent ff2bc57 commit 66a99f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
2 changes: 2 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
* In the original *DOOM*, if the player moved around while the automap was open, walls seen by the player for the first time weren’t mapped. This behavior can now be restored by disabling the new `am_dynamic` CVAR, which is `on` by default and `off` when vanilla mode is enabled.
* The automap now displays correctly when zooming out in very large maps.
* The grid now always covers the entire screen when the `am_rotatemode` CVAR is `on`.
* A bug is fixed whereby the player’s path would stop being drawn after the player teleported and the `am_rotatemode` CVAR was `off`.
* A bug is fixed whereby the player’s path would display incorrectly at the start of a map in some instances.
* The fuzz effect from spectres and the partial invisibility power-up now:
* Doesn't cause the status bar to bleed into the player's view while the console is open.
* Freezes along with everything else when freeze mode is enabled.
Expand Down
34 changes: 8 additions & 26 deletions src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ static void AM_DrawWalls_Cheating(void)
}

static void AM_DrawPlayerArrow(const mline_t *lineguy, const int lineguylines,
const angle_t angle, const fixed_t x, const fixed_t y)
const angle_t angle, const fixed_t x, const fixed_t y, void (*putdot)(int, int, const byte *))
{
for (int i = 0; i < lineguylines; i++)
{
Expand All @@ -1715,25 +1715,7 @@ static void AM_DrawPlayerArrow(const mline_t *lineguy, const int lineguylines,
AM_Rotate(&x1, &y1, angle);
AM_Rotate(&x2, &y2, angle);

AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &playercolor, putbigdot2);
}
}

static void AM_DrawTranslucentPlayerArrow(const mline_t *lineguy, const int lineguylines,
angle_t angle, const fixed_t x, const fixed_t y)
{
for (int i = 0; i < lineguylines; i++)
{
const mline_t line = lineguy[i];
int x1 = line.a.x;
int y1 = line.a.y;
int x2 = line.b.x;
int y2 = line.b.y;

AM_Rotate(&x1, &y1, angle);
AM_Rotate(&x2, &y2, angle);

AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &playercolor, &PUTTRANSLUCENTDOT);
AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &playercolor, putdot);
}
}

Expand Down Expand Up @@ -1811,14 +1793,14 @@ static void AM_DrawPlayer(void)
if (viewplayer->cheats & (CF_ALLMAP | CF_ALLMAP_THINGS))
{
if (invisibility && (invisibility > STARTFLASHING || (invisibility & FLASHONTIC)))
AM_DrawTranslucentPlayerArrow(cheatplayerarrow, CHEATPLAYERARROWLINES, angle, point.x, point.y);
AM_DrawPlayerArrow(cheatplayerarrow, CHEATPLAYERARROWLINES, angle, point.x, point.y, &PUTTRANSLUCENTDOT);
else
AM_DrawPlayerArrow(cheatplayerarrow, CHEATPLAYERARROWLINES, angle, point.x, point.y);
AM_DrawPlayerArrow(cheatplayerarrow, CHEATPLAYERARROWLINES, angle, point.x, point.y, putbigdot2);
}
else if (invisibility && (invisibility > STARTFLASHING || (invisibility & FLASHONTIC)))
AM_DrawTranslucentPlayerArrow(playerarrow, PLAYERARROWLINES, angle, point.x, point.y);
AM_DrawPlayerArrow(playerarrow, CHEATPLAYERARROWLINES, angle, point.x, point.y, &PUTTRANSLUCENTDOT);
else
AM_DrawPlayerArrow(playerarrow, PLAYERARROWLINES, angle, point.x, point.y);
AM_DrawPlayerArrow(playerarrow, PLAYERARROWLINES, angle, point.x, point.y, putbigdot2);
}

#define THINGTRIANGLELINES 3
Expand Down Expand Up @@ -2037,7 +2019,7 @@ static void AM_DrawPath(void)
end.x = breadcrumb[i].x >> FRACTOMAPBITS;
end.y = breadcrumb[i].y >> FRACTOMAPBITS;

if (ABS(start.x - end.x) > 4 * FRACUNIT || ABS(start.y - end.y) > 4 * FRACUNIT)
if (i > 1 && (ABS(start.x - end.x) > 4 * FRACUNIT || ABS(start.y - end.y) > 4 * FRACUNIT))
continue;

if (am_rotatemode)
Expand Down Expand Up @@ -2279,7 +2261,7 @@ void AM_Drawer(void)
else
AM_DrawWalls();

if (am_path && numbreadcrumbs)
if (am_path && numbreadcrumbs > 0)
AM_DrawPath();

if (things)
Expand Down

0 comments on commit 66a99f8

Please sign in to comment.