[Scummvm-cvs-logs] SF.net SVN: scummvm:[48267] scummvm/trunk/engines/scumm/costume.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Mar 16 09:38:08 CET 2010


Revision: 48267
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48267&view=rev
Author:   Kirben
Date:     2010-03-16 08:38:06 +0000 (Tue, 16 Mar 2010)

Log Message:
-----------
Add patch #2970899 - MM V0: flipped limbs drawing fix.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/costume.cpp

Modified: scummvm/trunk/engines/scumm/costume.cpp
===================================================================
--- scummvm/trunk/engines/scumm/costume.cpp	2010-03-16 08:26:08 UTC (rev 48266)
+++ scummvm/trunk/engines/scumm/costume.cpp	2010-03-16 08:38:06 UTC (rev 48267)
@@ -1212,37 +1212,19 @@
 	if (!width || !height)
 		return 0;
 
-	int xpos = 0;
-	int ypos = _loaded._maxHeight - offsetY;
+	int xpos = _actorX + (flipped ? -1 : +1) * (offsetX * 8 - a->_width / 2);
+	// +1 as we appear to be 1 pixel away from the original interpreter
+	int ypos = _actorY - offsetY + 1;
 
-	if (flipped) {
-		if (offsetX)
-			xpos += (offsetX - 1) * 8;
-	} else {
-		xpos += offsetX * 8;
-	}
-
-	xpos += _actorX - (a->_width / 2);
-	ypos += (_actorY - _loaded._maxHeight) + 1;		// +1 as we appear to be 1 pixel away from the original interpreter
-
 	// This code is very similar to procC64()
 	for (int y = 0; y < height; ++y) {
 		for (int x = 0; x < width; ++x) {
 			byte color = data[y * width + x];
 			byte pcolor;
-			int realX = 0;
-			if (flipped) {
-				if (offsetX == 0||offsetX == 1) {
-					realX = width-(x + 1);
-				} else if (offsetX == 2) {
-					realX = width-(x + 2);
-				}
-			} else {
-				realX = x;
-			}
 
-			int destY = y + ypos;
-			int destX = realX * 8 + xpos;
+			int destX = xpos + (flipped ? -(x + 1) : x) * 8;
+			int destY = ypos + y;
+
 			if (destY >= 0 && destY < _out.h && destX >= 0 && destX < _out.w) {
 				byte *dst = (byte *)_out.pixels + destY * _out.pitch + destX;
 				byte *mask = _vm->getMaskBuffer(0, destY, _zbuf);
@@ -1257,8 +1239,10 @@
 
 	_draw_top = MIN(_draw_top, ypos);
 	_draw_bottom = MAX(_draw_bottom, ypos + height);
-	_vm->markRectAsDirty(kMainVirtScreen, xpos, xpos + (width * 8), ypos, ypos + height, _actorID);
-
+	if (flipped)
+		_vm->markRectAsDirty(kMainVirtScreen, xpos - (width * 8), xpos, ypos, ypos + height, _actorID);
+	else
+		_vm->markRectAsDirty(kMainVirtScreen, xpos, xpos + (width * 8), ypos, ypos + height, _actorID);
 	return 0;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list