Skip to content

Commit 14c4cbb

Browse files
committed
Correct aspect ratio for player arrow and thing triangles
1 parent b389035 commit 14c4cbb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/am_map.c

+13-3
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ static byte *am_crosshaircolor2;
121121
#define CXMTOF(x) MTOF((x) - m_x)
122122
#define CYMTOF(y) (MAPHEIGHT - MTOF((y) - m_y))
123123

124-
#define AM_CORRECTASPECTRATIO (5 * FRACUNIT / 6)
125-
126124
typedef struct
127125
{
128126
mpoint_t a;
@@ -1154,7 +1152,7 @@ static void AM_RotatePoint(mpoint_t *point)
11541152

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

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

1716+
if (am_correctaspectratio)
1717+
{
1718+
y1 = 5 * y1 / 6;
1719+
y2 = 5 * y2 / 6;
1720+
}
1721+
17181722
AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &playercolor, putdot);
17191723
}
17201724
}
@@ -1733,6 +1737,12 @@ static void AM_DrawThingTriangle(const mline_t *lineguy, const int lineguylines,
17331737
AM_Rotate(&x1, &y1, angle);
17341738
AM_Rotate(&x2, &y2, angle);
17351739

1740+
if (am_correctaspectratio)
1741+
{
1742+
y1 = 5 * y1 / 6;
1743+
y2 = 5 * y2 / 6;
1744+
}
1745+
17361746
AM_DrawFline(x + x1, y + y1, x + x2, y + y2, &color, putdot);
17371747
}
17381748
}

0 commit comments

Comments
 (0)