diff options
author | Tobia Tesan | 2013-07-09 20:57:03 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-08-01 00:03:46 +0200 |
commit | b34d7b753912af6dd971872cd702d489974606ff (patch) | |
tree | 621c07f2ce02c9be03a9d1787398314b5a1621bb /engines/wintermute/graphics/transform_tools.cpp | |
parent | 0b21d6dca2ad5be41fa2aa4c2bed2cb694fba4d1 (diff) | |
download | scummvm-rg350-b34d7b753912af6dd971872cd702d489974606ff.tar.gz scummvm-rg350-b34d7b753912af6dd971872cd702d489974606ff.tar.bz2 scummvm-rg350-b34d7b753912af6dd971872cd702d489974606ff.zip |
WINTERMUTE: *transform as pointer in transform_tools
Diffstat (limited to 'engines/wintermute/graphics/transform_tools.cpp')
-rw-r--r-- | engines/wintermute/graphics/transform_tools.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/engines/wintermute/graphics/transform_tools.cpp b/engines/wintermute/graphics/transform_tools.cpp index f0a092a31b..2388b88236 100644 --- a/engines/wintermute/graphics/transform_tools.cpp +++ b/engines/wintermute/graphics/transform_tools.cpp @@ -43,7 +43,10 @@ namespace Wintermute { return newPoint; } - Rect32 TransformTools::newRect (Rect32 oldRect, TransformStruct transform, Point32 *newHotspot) { + Rect32 TransformTools::newRect (Rect32 oldRect, TransformStruct *transform, Point32 *newHotspot) { + + assert (transform); + Point32 nw(oldRect.left, oldRect.top); Point32 ne(oldRect.right, oldRect.top); Point32 sw(oldRect.left, oldRect.bottom); @@ -51,10 +54,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 +68,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; } |