aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/graphics/transform_tools.cpp
diff options
context:
space:
mode:
authorTobia Tesan2013-07-10 11:42:16 +0200
committerTobia Tesan2013-08-01 00:04:21 +0200
commit9f97ad6a3e9e10fa7164a4e545c1705896f77925 (patch)
tree5e6990f84f185d2e635c81eb9c36eaa268c7da14 /engines/wintermute/graphics/transform_tools.cpp
parentf014cccb94e0b3244a3e6dca91db7ca7552e6d79 (diff)
downloadscummvm-rg350-9f97ad6a3e9e10fa7164a4e545c1705896f77925.tar.gz
scummvm-rg350-9f97ad6a3e9e10fa7164a4e545c1705896f77925.tar.bz2
scummvm-rg350-9f97ad6a3e9e10fa7164a4e545c1705896f77925.zip
WINTERMUTE: s/*transform/const &transform/
Diffstat (limited to 'engines/wintermute/graphics/transform_tools.cpp')
-rw-r--r--engines/wintermute/graphics/transform_tools.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/engines/wintermute/graphics/transform_tools.cpp b/engines/wintermute/graphics/transform_tools.cpp
index 0ab28eb275..194bedec64 100644
--- a/engines/wintermute/graphics/transform_tools.cpp
+++ b/engines/wintermute/graphics/transform_tools.cpp
@@ -40,9 +40,7 @@ namespace Wintermute {
return newPoint;
}
- Rect32 TransformTools::newRect (Rect32 oldRect, TransformStruct *transform, Point32 *newHotspot) {
-
- assert (transform);
+ Rect32 TransformTools::newRect (Rect32 oldRect, const TransformStruct &transform, Point32 *newHotspot) {
Point32 nw(oldRect.left, oldRect.top);
Point32 ne(oldRect.right, oldRect.top);
@@ -51,10 +49,10 @@ namespace Wintermute {
FloatPoint nw1, ne1, sw1, se1;
- nw1 = transformPoint(nw - transform->_hotspot, transform->_angle, transform->_zoom);
- ne1 = transformPoint(ne - transform->_hotspot, transform->_angle, transform->_zoom);
- sw1 = transformPoint(sw - transform->_hotspot, transform->_angle, transform->_zoom);
- se1 = transformPoint(se - transform->_hotspot, transform->_angle, transform->_zoom);
+ nw1 = transformPoint(nw - transform._hotspot, transform._angle, transform._zoom);
+ ne1 = transformPoint(ne - transform._hotspot, transform._angle, transform._zoom);
+ sw1 = transformPoint(sw - transform._hotspot, transform._angle, transform._zoom);
+ se1 = transformPoint(se - transform._hotspot, transform._angle, transform._zoom);
float top = MIN(nw1.y, MIN(ne1.y, MIN(sw1.y, se1.y)));
float bottom = MAX(nw1.y, MAX(ne1.y, MAX(sw1.y, se1.y)));
@@ -65,10 +63,10 @@ namespace Wintermute {
newHotspot->y = -floor(top);
newHotspot->x = -floor(left);
- res.top = floor(top) + transform->_hotspot.y;
- res.bottom = ceil(bottom) + transform->_hotspot.y;
- res.left = floor(left) + transform->_hotspot.x;
- res.right = ceil(right) + transform->_hotspot.x;
+ res.top = floor(top) + transform._hotspot.y;
+ res.bottom = ceil(bottom) + transform._hotspot.y;
+ res.left = floor(left) + transform._hotspot.x;
+ res.right = ceil(right) + transform._hotspot.x;
return res;
}