diff --git a/src/am_map.cpp b/src/am_map.cpp index 7a556542a..a8076550c 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -2070,7 +2070,7 @@ void AM_drawSubsectors() originx, originy, scale / (FIXED2DBL(scalex) * float(1 << MAPBITS)), scale / (FIXED2DBL(scaley) * float(1 << MAPBITS)), - rotation, + ANGLE2DBL(rotation), colormap, floorlight ); diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 8d3453fa4..2d3b1e3e2 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -1152,7 +1152,7 @@ void DCanvas::Clear (int left, int top, int right, int bottom, int palcolor, uin //========================================================================== void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, - double originx, double originy, double scalex, double scaley, angle_t rotation, + double originx, double originy, double scalex, double scaley, DAngle rotation, FDynamicColormap *colormap, int lightlevel) { #ifndef NO_SWRENDER @@ -1163,8 +1163,7 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, int i; int y1, y2, y; fixed_t x; - double rot = rotation * M_PI / double(1u << 31); - bool dorotate = rot != 0; + bool dorotate = rotation != 0.; double cosrot, sinrot; if (--npoints < 2 || Buffer == NULL) @@ -1205,8 +1204,9 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, scalex /= FIXED2DBL(tex->xScale); scaley /= FIXED2DBL(tex->yScale); - cosrot = cos(rot); - sinrot = sin(rot); + // Use the CRT's functions here. + cosrot = cos(ToRadians(rotation)); + sinrot = sin(ToRadians(rotation)); // Setup constant texture mapping parameters. R_SetupSpanBits(tex); diff --git a/src/v_video.h b/src/v_video.h index 269641373..533adb52e 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -180,7 +180,7 @@ public: // Fill a simple polygon with a texture virtual void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, - double originx, double originy, double scalex, double scaley, angle_t rotation, + double originx, double originy, double scalex, double scaley, DAngle rotation, struct FDynamicColormap *colormap, int lightlevel); // Set an area to a specified color diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index 17c548c29..8a6e7e50f 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -3071,7 +3071,7 @@ void D3DFB::FlatFill(int left, int top, int right, int bottom, FTexture *src, bo void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints, double originx, double originy, double scalex, double scaley, - angle_t rotation, FDynamicColormap *colormap, int lightlevel) + DAngle rotation, FDynamicColormap *colormap, int lightlevel) { // Use an equation similar to player sprites to determine shade fixed_t shade = LIGHT2SHADE(lightlevel) - 12*FRACUNIT; @@ -3083,8 +3083,7 @@ void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints, D3DCOLOR color0, color1; float ox, oy; float cosrot, sinrot; - float rot = float(rotation * M_PI / float(1u << 31)); - bool dorotate = rot != 0; + bool dorotate = rotation != 0; if (npoints < 3) { // This is no polygon. @@ -3105,8 +3104,8 @@ void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints, return; } - cosrot = cos(rot); - sinrot = sin(rot); + cosrot = (float)cos(ToRadians(rotation)); + sinrot = (float)sin(ToRadians(rotation)); CheckQuadBatch(npoints - 2, npoints); quad = &QuadExtra[QuadBatchPos]; diff --git a/src/win32/win32iface.h b/src/win32/win32iface.h index 00a34578a..f8fcd1fba 100644 --- a/src/win32/win32iface.h +++ b/src/win32/win32iface.h @@ -265,7 +265,7 @@ public: void DrawPixel(int x, int y, int palcolor, uint32 rgbcolor); void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints, double originx, double originy, double scalex, double scaley, - angle_t rotation, FDynamicColormap *colormap, int lightlevel); + DAngle rotation, FDynamicColormap *colormap, int lightlevel); bool WipeStartScreen(int type); void WipeEndScreen(); bool WipeDo(int ticks);