From f014cccb94e0b3244a3e6dca91db7ca7552e6d79 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 10 Jul 2013 11:27:50 +0200 Subject: WINTERMUTE: Formatting --- engines/wintermute/graphics/transform_tools.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'engines/wintermute') diff --git a/engines/wintermute/graphics/transform_tools.cpp b/engines/wintermute/graphics/transform_tools.cpp index 2388b88236..0ab28eb275 100644 --- a/engines/wintermute/graphics/transform_tools.cpp +++ b/engines/wintermute/graphics/transform_tools.cpp @@ -27,19 +27,16 @@ namespace Wintermute { FloatPoint TransformTools::transformPoint(FloatPoint point, float rotate, Point32 zoom, bool mirrorX, bool mirrorY) { - /* - * Returns the coordinates for a point after rotation - */ float rotateRad = rotate * M_PI / 180; FloatPoint newPoint; - newPoint.x = (point.x * cos(rotateRad) - point.y * sin(rotateRad))*zoom.x/100.0; - newPoint.y = (point.x * sin(rotateRad) + point.y * cos(rotateRad))*zoom.y/100.0; - if (mirrorX) newPoint.x *= -1; - if (mirrorY) newPoint.y *= -1; - /* - * I apply the textbook formula, but first I reverse the Y-axis, otherwise - * I'd be performing a rotation in the wrong direction - */ + newPoint.x = (point.x * cos(rotateRad) - point.y * sin(rotateRad))*zoom.x/DEFAULT_ZOOM_X; + newPoint.y = (point.x * sin(rotateRad) + point.y * cos(rotateRad))*zoom.y/DEFAULT_ZOOM_Y; + if (mirrorX) { + newPoint.x *= -1; + } + if (mirrorY) { + newPoint.y *= -1; + } return newPoint; } -- cgit v1.2.3