[Scummvm-cvs-logs] CVS: scummvm/scumm sprite_he.cpp,1.59,1.60

kirben kirben at users.sourceforge.net
Fri Feb 25 15:42:42 CET 2005


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

Modified Files:
	sprite_he.cpp 
Log Message:

More work on findSpriteWithClassOf()


Index: sprite_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sprite_he.cpp,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- sprite_he.cpp	25 Feb 2005 20:15:01 -0000	1.59
+++ sprite_he.cpp	25 Feb 2005 23:37:25 -0000	1.60
@@ -73,9 +73,10 @@
 				continue;
 			return i;
 		} else {
-			int state;
-			int resId = spi->field_4C;
+			int resId, state, rot_angle, zoom;
+			int32 w, h;
 
+			resId = spi->field_4C;
 			if (spi->field_80) {
 				int16 x1, x2, y1, y2;
 
@@ -109,9 +110,22 @@
 				state = spi->field_48;
 			}
 
+			rot_angle = spi->field_68;
+			zoom = spi->field_6C;
 			if ((spi->flags & kSFZoomed) || (spi->flags & kSFRotated)) {
-				// TODO
+				if (spi->flags & kSFZoomed && zoom) {
+					x = x * 256 / zoom;
+					y = y * 256 / zoom;
+				}
+				if (spi->flags & kSFRotated && rot_angle) {
+					// TODO
+					Common::Point pts[1];
+					_wiz.polygonRotatePoints(pts, 1, rot_angle);
+				}
 
+				getWizImageDim(resId, state, w, h);
+				x += w / 2;
+				y += h / 2;
 			}
 
 			if(isWizPixelNonTransparent(rtImage, resId, state, x, y, spi->imgFlags));
@@ -1293,13 +1307,13 @@
 				pts[0].x = pts[0].y = pts[1].y = pts[3].x = -w / 2;
 				pts[2].y = pts[3].y = h / 2 - 1;
 
-				if (spi->flags & kSFZoomed) {
+				if (spi->flags & kSFZoomed && zoom) {
 					for (int j = 0; j < 4; ++j) {
 						pts[j].x = pts[i].x * zoom / 256;
 						pts[j].y = pts[i].y * zoom / 256;
 					}
 				}
-				if (spi->flags & kSFRotated)
+				if (spi->flags & kSFRotated && rot_angle)
 					_wiz.polygonRotatePoints(pts, 4, rot_angle);
 
 				for (int j = 0; j < 4; ++j) {





More information about the Scummvm-git-logs mailing list