diff options
author | Tobia Tesan | 2013-07-10 11:27:50 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-08-01 00:03:50 +0200 |
commit | f014cccb94e0b3244a3e6dca91db7ca7552e6d79 (patch) | |
tree | daf064c85f7920cc9b40b0f42dce08ab1cf9da55 /engines/wintermute | |
parent | 0153f762b16d33c350cde5f472bba42733f18dc7 (diff) | |
download | scummvm-rg350-f014cccb94e0b3244a3e6dca91db7ca7552e6d79.tar.gz scummvm-rg350-f014cccb94e0b3244a3e6dca91db7ca7552e6d79.tar.bz2 scummvm-rg350-f014cccb94e0b3244a3e6dca91db7ca7552e6d79.zip |
WINTERMUTE: Formatting
Diffstat (limited to 'engines/wintermute')
-rw-r--r-- | engines/wintermute/graphics/transform_tools.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
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; } |