Skip to content

Commit

Permalink
Correct aspect ratio for player arrow and thing triangles
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 14, 2024
1 parent b389035 commit 14c4cbb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ static byte *am_crosshaircolor2;
#define CXMTOF(x) MTOF((x) - m_x)
#define CYMTOF(y) (MAPHEIGHT - MTOF((y) - m_y))

#define AM_CORRECTASPECTRATIO (5 * FRACUNIT / 6)

typedef struct
{
mpoint_t a;
Expand Down Expand Up @@ -1154,7 +1152,7 @@ static void AM_RotatePoint(mpoint_t *point)

static void AM_CorrectAspectRatio(mpoint_t *point)
{
point->y = am_frame.center.y + FixedMul(point->y - am_frame.center.y, AM_CORRECTASPECTRATIO);
point->y = am_frame.center.y + 5 * (point->y - am_frame.center.y) / 6;
}

//
Expand Down Expand Up @@ -1715,6 +1713,12 @@ static void AM_DrawPlayerArrow(const mline_t *lineguy, const int lineguylines,
AM_Rotate(&x1, &y1, angle);
AM_Rotate(&x2, &y2, angle);

if (am_correctaspectratio)
{
y1 = 5 * y1 / 6;
y2 = 5 * y2 / 6;
}

AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &playercolor, putdot);
}
}
Expand All @@ -1733,6 +1737,12 @@ static void AM_DrawThingTriangle(const mline_t *lineguy, const int lineguylines,
AM_Rotate(&x1, &y1, angle);
AM_Rotate(&x2, &y2, angle);

if (am_correctaspectratio)
{
y1 = 5 * y1 / 6;
y2 = 5 * y2 / 6;
}

AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &color, putdot);
}
}
Expand Down

0 comments on commit 14c4cbb

Please sign in to comment.