diff options
-rw-r--r-- | graphics/transform_tools.cpp | 3 | ||||
-rw-r--r-- | graphics/transparent_surface.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/graphics/transform_tools.cpp b/graphics/transform_tools.cpp index 6e87b6321a..a0617ff236 100644 --- a/graphics/transform_tools.cpp +++ b/graphics/transform_tools.cpp @@ -22,12 +22,13 @@ #include "graphics/transform_tools.h" +#include "common/math.h" #include <math.h> namespace Graphics { FloatPoint TransformTools::transformPoint(FloatPoint point, const float rotate, const Common::Point &zoom, const bool mirrorX, const bool mirrorY) { - float rotateRad = rotate * M_PI / 180.0f; + float rotateRad = Common::deg2rad<float>(rotate); float x = point.x; float y = point.y; x = (x * zoom.x) / kDefaultZoomX; diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp index 10f69b5281..2a6fa7bfdf 100644 --- a/graphics/transparent_surface.cpp +++ b/graphics/transparent_surface.cpp @@ -796,8 +796,9 @@ TransparentSurface *TransparentSurface::rotoscaleT(const TransformStruct &transf } uint32 invAngle = 360 - (transform._angle % 360); - float invCos = cos(invAngle * M_PI / 180.0); - float invSin = sin(invAngle * M_PI / 180.0); + float invAngleRad = Common::deg2rad<uint32,float>(invAngle); + float invCos = cos(invAngleRad); + float invSin = sin(invAngleRad); int icosx = (int)(invCos * (65536.0f * kDefaultZoomX / transform._zoom.x)); int isinx = (int)(invSin * (65536.0f * kDefaultZoomX / transform._zoom.x)); |