aboutsummaryrefslogtreecommitdiff
path: root/scumm/wiz_he.cpp
diff options
context:
space:
mode:
authorGregory Montoir2006-01-30 19:29:28 +0000
committerGregory Montoir2006-01-30 19:29:28 +0000
commitea2c7b7d28d5abfc3dd8614de79641fa3b7f079e (patch)
tree5f552e2ff65b4cc064fd7f806f733f4ea43f926f /scumm/wiz_he.cpp
parent5465d3206cd09ff93413648789e87aeca1c4370f (diff)
downloadscummvm-rg350-ea2c7b7d28d5abfc3dd8614de79641fa3b7f079e.tar.gz
scummvm-rg350-ea2c7b7d28d5abfc3dd8614de79641fa3b7f079e.tar.bz2
scummvm-rg350-ea2c7b7d28d5abfc3dd8614de79641fa3b7f079e.zip
Changed transformation origin computation (the previous code is matching pajama2 disasm, but looks wrong to me).
svn-id: r20316
Diffstat (limited to 'scumm/wiz_he.cpp')
-rw-r--r--scumm/wiz_he.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp
index 92cae1ec1f..947acd68ae 100644
--- a/scumm/wiz_he.cpp
+++ b/scumm/wiz_he.cpp
@@ -1184,20 +1184,25 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int s
int32 w, h;
getWizImageDim(resNum, state, w, h);
+ // set the transformation origin to the center of the image
+ pts[0].x = pts[3].x = -(w / 2);
pts[1].x = pts[2].x = w / 2 - 1;
- pts[0].x = pts[0].y = pts[1].y = pts[3].x = -(w / 2);
+ pts[0].y = pts[1].y = -(h / 2);
pts[2].y = pts[3].y = h / 2 - 1;
- // transform points
+ // scale
if (scale != 256) {
for (int i = 0; i < 4; ++i) {
pts[i].x = pts[i].x * scale / 256;
pts[i].y = pts[i].y * scale / 256;
}
}
+
+ // rotate
if (angle)
polygonRotatePoints(pts, 4, angle);
+ // translate
for (int i = 0; i < 4; ++i) {
pts[i].x += po_x;
pts[i].y += po_y;