diff options
author | Tobia Tesan | 2013-06-27 15:47:05 +0200 |
---|---|---|
committer | Tobia Tesan | 2013-07-31 23:47:57 +0200 |
commit | 3c0089e31e1392f38cfb0e13d7c4d395bad4f949 (patch) | |
tree | dd4b8f89e328a6c37f9b1d392bca535230562f94 /engines/wintermute/base/base_sub_frame.cpp | |
parent | 03c4b7a240d53b36c86aea564fb8ae0b0a747604 (diff) | |
download | scummvm-rg350-3c0089e31e1392f38cfb0e13d7c4d395bad4f949.tar.gz scummvm-rg350-3c0089e31e1392f38cfb0e13d7c4d395bad4f949.tar.bz2 scummvm-rg350-3c0089e31e1392f38cfb0e13d7c4d395bad4f949.zip |
WINTERMUTE: Introduce TransformTools
Diffstat (limited to 'engines/wintermute/base/base_sub_frame.cpp')
-rw-r--r-- | engines/wintermute/base/base_sub_frame.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp index d93cf667f1..d9620d3939 100644 --- a/engines/wintermute/base/base_sub_frame.cpp +++ b/engines/wintermute/base/base_sub_frame.cpp @@ -38,6 +38,8 @@ #include "engines/wintermute/base/gfx/base_renderer.h" #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/scriptables/script_stack.h" +#include "engines/wintermute/graphics/transform_tools.h" +#include "engines/wintermute/graphics/transform_struct.h" namespace Wintermute { @@ -256,6 +258,15 @@ bool BaseSubFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, fl } if (rotate != 0.0f) { + Point32 boxOffset, rotatedHotspot, hotspotOffset, newOrigin; + Point32 origin(x, y); + Rect32 oldRect = getRect(); + Point32 newHotspot; + TransformStruct transform = TransformStruct(zoomX, zoomY, rotate, _hotspotX, _hotspotY, blendMode, alpha, _mirrorX, _mirrorY, 0, 0); + Rect32 newRect = TransformTools::newRect (oldRect, transform, &newHotspot); + newOrigin = origin - newHotspot; + // When the transform functions are refactored to use TransformStruct this will be like: + // res = _surface->displayTransform(newOrigin.x, newOrigin.y, oldRect, newRect, transformStruct); res = _surface->displayTransform((int)(x - _hotspotX * (zoomX / 100)), (int)(y - _hotspotY * (zoomY / 100)), _hotspotX, _hotspotY, getRect(), zoomX, zoomY, alpha, rotate, blendMode, _mirrorX, _mirrorY); } else { if (zoomX == 100 && zoomY == 100) { |