[Scummvm-cvs-logs] CVS: scummvm/scumm wiz_he.cpp,2.114,2.115

Gregory Montoir cyx at users.sourceforge.net
Mon Jan 30 11:30:05 CET 2006


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11412

Modified Files:
	wiz_he.cpp 
Log Message:
Changed transformation origin computation (the previous code is matching pajama2 disasm, but looks wrong to me).

Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.114
retrieving revision 2.115
diff -u -d -r2.114 -r2.115
--- wiz_he.cpp	30 Jan 2006 19:20:51 -0000	2.114
+++ wiz_he.cpp	30 Jan 2006 19:29:28 -0000	2.115
@@ -1184,20 +1184,25 @@
 	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;





More information about the Scummvm-git-logs mailing list