From 6f03fbac843410f457115bd075a6926ed3924ce0 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 10 Jul 2013 12:46:32 +0200 Subject: WINTERMUTE: Pass structs by const reference --- engines/wintermute/graphics/transform_tools.cpp | 4 ++-- engines/wintermute/graphics/transform_tools.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/wintermute/graphics') diff --git a/engines/wintermute/graphics/transform_tools.cpp b/engines/wintermute/graphics/transform_tools.cpp index 9e736366c3..01e8b486ce 100644 --- a/engines/wintermute/graphics/transform_tools.cpp +++ b/engines/wintermute/graphics/transform_tools.cpp @@ -26,7 +26,7 @@ namespace Wintermute { - FloatPoint TransformTools::transformPoint(FloatPoint point, float rotate, Point32 zoom, bool mirrorX, bool mirrorY) { + FloatPoint TransformTools::transformPoint(const FloatPoint &point, const float rotate, const Point32 &zoom, const bool mirrorX, const bool mirrorY) { float rotateRad = rotate * M_PI / 180; FloatPoint newPoint; newPoint.x = (point.x * cos(rotateRad) - point.y * sin(rotateRad))*zoom.x/DEFAULT_ZOOM_X; @@ -40,7 +40,7 @@ namespace Wintermute { return newPoint; } - Rect32 TransformTools::newRect (Rect32 oldRect, const TransformStruct &transform, Point32 *newHotspot) { + Rect32 TransformTools::newRect (const Rect32 &oldRect, const TransformStruct &transform, Point32 *newHotspot) { Point32 nw(oldRect.left, oldRect.top); Point32 ne(oldRect.right, oldRect.top); diff --git a/engines/wintermute/graphics/transform_tools.h b/engines/wintermute/graphics/transform_tools.h index ee4d16acb0..a9eabffe26 100644 --- a/engines/wintermute/graphics/transform_tools.h +++ b/engines/wintermute/graphics/transform_tools.h @@ -33,7 +33,7 @@ public: /** * Basic transform (scale + rotate) for a single point */ - static FloatPoint transformPoint(FloatPoint point, float rotate, Point32 zoom, bool mirrorX = false, bool mirrorY = false); + static FloatPoint transformPoint(const FloatPoint &point, const float rotate, const Point32 &zoom, const bool mirrorX = false, const bool mirrorY = false); /** * Takes a rectangle, a transform and a pointer to a point, "newHotspot". @@ -41,7 +41,7 @@ public: * and, as a side-effect, "newHotspot" will tell you where the hotspot will * have ended up in the new rect, for centering. */ - static Rect32 newRect (Rect32 oldRect, const TransformStruct &transform, Point32 *newHotspot); + static Rect32 newRect (const Rect32 &oldRect, const TransformStruct &transform, Point32 *newHotspot); }; } // End of namespace Wintermute #endif -- cgit v1.2.3