@@ -1154,8 +1154,7 @@ static void AM_RotatePoint(mpoint_t *point)
1154
1154
1155
1155
static void AM_CorrectAspectRatio (mpoint_t * point )
1156
1156
{
1157
- if (am_correctaspectratio )
1158
- point -> y = am_frame .center .y + FixedMul (point -> y - am_frame .center .y , AM_CORRECTASPECTRATIO );
1157
+ point -> y = am_frame .center .y + FixedMul (point -> y - am_frame .center .y , AM_CORRECTASPECTRATIO );
1159
1158
}
1160
1159
1161
1160
//
@@ -1424,21 +1423,6 @@ static void AM_DrawFline(int x0, int y0, int x1, int y1, const byte *color,
1424
1423
}
1425
1424
}
1426
1425
1427
- static mline_t (* rotatelinefunc )(mline_t );
1428
-
1429
- static mline_t AM_RotateLine (mline_t mline )
1430
- {
1431
- AM_RotatePoint (& mline .a );
1432
- AM_RotatePoint (& mline .b );
1433
-
1434
- return mline ;
1435
- }
1436
-
1437
- static mline_t AM_DoNotRotateLine (mline_t mline )
1438
- {
1439
- return mline ;
1440
- }
1441
-
1442
1426
//
1443
1427
// Draws flat (floor/ceiling tile) aligned grid lines.
1444
1428
//
@@ -1463,9 +1447,18 @@ static void AM_DrawGrid(void)
1463
1447
{
1464
1448
mline_t mline = { { x , starty }, { x , endy } };
1465
1449
1466
- mline = rotatelinefunc (mline );
1467
- AM_CorrectAspectRatio (& mline .a );
1468
- AM_CorrectAspectRatio (& mline .b );
1450
+ if (am_rotatemode )
1451
+ {
1452
+ AM_RotatePoint (& mline .a );
1453
+ AM_RotatePoint (& mline .b );
1454
+ }
1455
+
1456
+ if (am_correctaspectratio )
1457
+ {
1458
+ AM_CorrectAspectRatio (& mline .a );
1459
+ AM_CorrectAspectRatio (& mline .b );
1460
+ }
1461
+
1469
1462
AM_DrawFline (mline .a .x , mline .a .y , mline .b .x , mline .b .y , & gridcolor , putbigdot2 );
1470
1463
}
1471
1464
@@ -1474,9 +1467,18 @@ static void AM_DrawGrid(void)
1474
1467
{
1475
1468
mline_t mline = { { startx , y }, { endx , y } };
1476
1469
1477
- mline = rotatelinefunc (mline );
1478
- AM_CorrectAspectRatio (& mline .a );
1479
- AM_CorrectAspectRatio (& mline .b );
1470
+ if (am_rotatemode )
1471
+ {
1472
+ AM_RotatePoint (& mline .a );
1473
+ AM_RotatePoint (& mline .b );
1474
+ }
1475
+
1476
+ if (am_correctaspectratio )
1477
+ {
1478
+ AM_CorrectAspectRatio (& mline .a );
1479
+ AM_CorrectAspectRatio (& mline .b );
1480
+ }
1481
+
1480
1482
AM_DrawFline (mline .a .x , mline .a .y , mline .b .x , mline .b .y , & gridcolor , putbigdot2 );
1481
1483
}
1482
1484
}
@@ -1542,9 +1544,17 @@ static void AM_DrawWalls(void)
1542
1544
const unsigned short special = line .special ;
1543
1545
byte * doorcolor ;
1544
1546
1545
- mline = rotatelinefunc (mline );
1546
- AM_CorrectAspectRatio (& mline .a );
1547
- AM_CorrectAspectRatio (& mline .b );
1547
+ if (am_rotatemode )
1548
+ {
1549
+ AM_RotatePoint (& mline .a );
1550
+ AM_RotatePoint (& mline .b );
1551
+ }
1552
+
1553
+ if (am_correctaspectratio )
1554
+ {
1555
+ AM_CorrectAspectRatio (& mline .a );
1556
+ AM_CorrectAspectRatio (& mline .b );
1557
+ }
1548
1558
1549
1559
if (special && (doorcolor = AM_DoorColor (special )) != cdwallcolor )
1550
1560
AM_DrawFline (mline .a .x , mline .a .y , mline .b .x , mline .b .y , doorcolor , putbigdot );
@@ -1594,9 +1604,17 @@ static void AM_DrawWalls_AllMap(void)
1594
1604
const unsigned short special = line .special ;
1595
1605
byte * doorcolor ;
1596
1606
1597
- mline = rotatelinefunc (mline );
1598
- AM_CorrectAspectRatio (& mline .a );
1599
- AM_CorrectAspectRatio (& mline .b );
1607
+ if (am_rotatemode )
1608
+ {
1609
+ AM_RotatePoint (& mline .a );
1610
+ AM_RotatePoint (& mline .b );
1611
+ }
1612
+
1613
+ if (am_correctaspectratio )
1614
+ {
1615
+ AM_CorrectAspectRatio (& mline .a );
1616
+ AM_CorrectAspectRatio (& mline .b );
1617
+ }
1600
1618
1601
1619
if (special && (doorcolor = AM_DoorColor (special )) != cdwallcolor )
1602
1620
AM_DrawFline (mline .a .x , mline .a .y , mline .b .x , mline .b .y , doorcolor , putbigdot );
@@ -1645,9 +1663,17 @@ static void AM_DrawWalls_Cheating(void)
1645
1663
const unsigned short special = line .special ;
1646
1664
byte * doorcolor ;
1647
1665
1648
- mline = rotatelinefunc (mline );
1649
- AM_CorrectAspectRatio (& mline .a );
1650
- AM_CorrectAspectRatio (& mline .b );
1666
+ if (am_rotatemode )
1667
+ {
1668
+ AM_RotatePoint (& mline .a );
1669
+ AM_RotatePoint (& mline .b );
1670
+ }
1671
+
1672
+ if (am_correctaspectratio )
1673
+ {
1674
+ AM_CorrectAspectRatio (& mline .a );
1675
+ AM_CorrectAspectRatio (& mline .b );
1676
+ }
1651
1677
1652
1678
if (special && (doorcolor = AM_DoorColor (special )) != cdwallcolor )
1653
1679
AM_DrawFline (mline .a .x , mline .a .y , mline .b .x , mline .b .y , doorcolor , putbigdot );
@@ -1779,7 +1805,8 @@ static void AM_DrawPlayer(void)
1779
1805
else
1780
1806
angle = viewangle >> ANGLETOFINESHIFT ;
1781
1807
1782
- AM_CorrectAspectRatio (& point );
1808
+ if (am_correctaspectratio )
1809
+ AM_CorrectAspectRatio (& point );
1783
1810
1784
1811
if (viewplayer -> cheats & (CF_ALLMAP | CF_ALLMAP_THINGS ))
1785
1812
{
@@ -1833,7 +1860,8 @@ static void AM_DrawThings(void)
1833
1860
if (am_rotatemode )
1834
1861
AM_RotatePoint (& point );
1835
1862
1836
- AM_CorrectAspectRatio (& point );
1863
+ if (am_correctaspectratio )
1864
+ AM_CorrectAspectRatio (& point );
1837
1865
1838
1866
if (!(flags & MF_SHOOTABLE ) && !(flags & MF_CORPSE ))
1839
1867
width = (12 << FRACBITS ) >> FRACTOMAPBITS ;
@@ -1866,7 +1894,8 @@ static void AM_DrawBloodSplats(void)
1866
1894
if (am_rotatemode )
1867
1895
AM_RotatePoint (& point );
1868
1896
1869
- AM_CorrectAspectRatio (& point );
1897
+ if (am_correctaspectratio )
1898
+ AM_CorrectAspectRatio (& point );
1870
1899
1871
1900
if ((fx = CXMTOF (point .x )) >= - BLOODSPLATWIDTH && fx <= MAPWIDTH + BLOODSPLATWIDTH
1872
1901
&& (fy = CYMTOF (point .y )) >= - BLOODSPLATWIDTH && fy <= MAPHEIGHT + BLOODSPLATWIDTH )
@@ -1939,7 +1968,8 @@ static void AM_DrawMarks(const char *nums[])
1939
1968
if (am_rotatemode )
1940
1969
AM_RotatePoint (& point );
1941
1970
1942
- AM_CorrectAspectRatio (& point );
1971
+ if (am_correctaspectratio )
1972
+ AM_CorrectAspectRatio (& point );
1943
1973
1944
1974
x = CXMTOF (point .x ) - MARKWIDTH / 2 + 1 ;
1945
1975
y = CYMTOF (point .y ) - MARKHEIGHT / 2 - 1 ;
@@ -2000,44 +2030,36 @@ static void AM_DrawPath(void)
2000
2030
mpoint_t end = { 0 , 0 };
2001
2031
mpoint_t player = { viewx >> FRACTOMAPBITS , viewy >> FRACTOMAPBITS };
2002
2032
2003
- if ( am_rotatemode )
2033
+ for ( int i = 1 ; i < numbreadcrumbs ; i ++ )
2004
2034
{
2005
- for (int i = 1 ; i < numbreadcrumbs ; i ++ )
2006
- {
2007
- mpoint_t start = { breadcrumb [i - 1 ].x >> FRACTOMAPBITS , breadcrumb [i - 1 ].y >> FRACTOMAPBITS };
2035
+ mpoint_t start = { breadcrumb [i - 1 ].x >> FRACTOMAPBITS , breadcrumb [i - 1 ].y >> FRACTOMAPBITS };
2008
2036
2009
- end .x = breadcrumb [i ].x >> FRACTOMAPBITS ;
2010
- end .y = breadcrumb [i ].y >> FRACTOMAPBITS ;
2037
+ end .x = breadcrumb [i ].x >> FRACTOMAPBITS ;
2038
+ end .y = breadcrumb [i ].y >> FRACTOMAPBITS ;
2011
2039
2012
- if (ABS (start .x - end .x ) > 4 * FRACUNIT || ABS (start .y - end .y ) > 4 * FRACUNIT )
2013
- continue ;
2040
+ if (ABS (start .x - end .x ) > 4 * FRACUNIT || ABS (start .y - end .y ) > 4 * FRACUNIT )
2041
+ continue ;
2014
2042
2043
+ if (am_rotatemode )
2044
+ {
2015
2045
AM_RotatePoint (& start );
2016
2046
AM_RotatePoint (& end );
2047
+ }
2048
+
2049
+ if (am_correctaspectratio )
2050
+ {
2017
2051
AM_CorrectAspectRatio (& start );
2018
2052
AM_CorrectAspectRatio (& end );
2019
- AM_DrawFline (start .x , start .y , end .x , end .y , & pathcolor , putbigdot2 );
2020
2053
}
2021
2054
2022
- AM_RotatePoint (& player );
2023
- AM_CorrectAspectRatio (& player );
2055
+ AM_DrawFline (start .x , start .y , end .x , end .y , & pathcolor , putbigdot2 );
2024
2056
}
2025
- else
2026
- {
2027
- mpoint_t start = { breadcrumb [0 ].x >> FRACTOMAPBITS , breadcrumb [0 ].y >> FRACTOMAPBITS };
2028
2057
2029
- for (int i = 1 ; i < numbreadcrumbs ; i ++ )
2030
- {
2031
- end .x = breadcrumb [i ].x >> FRACTOMAPBITS ;
2032
- end .y = breadcrumb [i ].y >> FRACTOMAPBITS ;
2033
-
2034
- if (ABS (start .x - end .x ) > 4 * FRACUNIT || ABS (start .y - end .y ) > 4 * FRACUNIT )
2035
- continue ;
2058
+ if (am_rotatemode )
2059
+ AM_RotatePoint (& player );
2036
2060
2037
- AM_DrawFline (start .x , start .y , end .x , end .y , & pathcolor , putbigdot2 );
2038
- start = end ;
2039
- }
2040
- }
2061
+ if (am_correctaspectratio )
2062
+ AM_CorrectAspectRatio (& player );
2041
2063
2042
2064
if (ABS (end .x - player .x ) <= 4 * FRACUNIT && ABS (end .y - player .y ) <= 4 * FRACUNIT )
2043
2065
AM_DrawFline (end .x , end .y , player .x , player .y , & pathcolor , putbigdot2 );
@@ -2190,11 +2212,7 @@ static void AM_SetFrameVariables(void)
2190
2212
2191
2213
am_frame .sin = finesine [angle ];
2192
2214
am_frame .cos = finecosine [angle ];
2193
-
2194
- rotatelinefunc = & AM_RotateLine ;
2195
2215
}
2196
- else
2197
- rotatelinefunc = & AM_DoNotRotateLine ;
2198
2216
}
2199
2217
2200
2218
static void AM_ApplyAntialiasing (void )
0 commit comments