[Scummvm-cvs-logs] SF.net SVN: scummvm:[49801] scummvm/trunk/engines/m4

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Tue Jun 15 13:19:32 CEST 2010


Revision: 49801
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49801&view=rev
Author:   dreammaster
Date:     2010-06-15 11:19:32 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Bugfixes to depth processing that was causing the 'Microprose Design Group' message not to appear in the first intro scene

Modified Paths:
--------------
    scummvm/trunk/engines/m4/graphics.cpp
    scummvm/trunk/engines/m4/graphics.h
    scummvm/trunk/engines/m4/mads_views.cpp

Modified: scummvm/trunk/engines/m4/graphics.cpp
===================================================================
--- scummvm/trunk/engines/m4/graphics.cpp	2010-06-15 11:06:14 UTC (rev 49800)
+++ scummvm/trunk/engines/m4/graphics.cpp	2010-06-15 11:19:32 UTC (rev 49801)
@@ -400,8 +400,8 @@
  * Copies a given image onto a destination surface with scaling, transferring only pixels that meet
  * the specified depth requirement on a secondary surface contain depth information
  */
-void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthsSurface, 
-						 int scale, int transparentColour) {
+void M4Surface::copyFrom(M4Surface *src, int destX, int destY, Common::Point destAdjust,
+						 int depth, M4Surface *depthsSurface, int scale, int transparentColour) {
 
 	if (scale == 100) {
 		// Copy the specified area
@@ -426,8 +426,8 @@
 		byte *data = src->getBasePtr();
 		byte *srcPtr = data + (src->width() * copyRect.top + copyRect.left);
 		byte *depthsData = depthsSurface->getBasePtr();
-		byte *depthsPtr = depthsData + (src->width() * copyRect.top + copyRect.left);
-		byte *destPtr = (byte *)pixels + (destY * width()) + destX;
+		byte *depthsPtr = depthsData + (depthsSurface->pitch * destY) + destX;
+		byte *destPtr = (byte *)pixels + ((destY + destAdjust.y) * pitch) + destX + destAdjust.x;
 
 		// 100% scaling variation
 		for (int rowCtr = 0; rowCtr < copyRect.height(); ++rowCtr) {
@@ -520,7 +520,7 @@
 	if (spriteHeight <= 0)
 		return;
 
-	byte *destPixelsP = this->getBasePtr(destX + spriteLeft, destY + spriteTop);
+	byte *destPixelsP = this->getBasePtr(destX + spriteLeft + destAdjust.x, destY + spriteTop + destAdjust.y);
 	const byte *depthPixelsP = depthsSurface->getBasePtr(destX + spriteLeft, destY + spriteTop);
 
 	spriteLeft = (spriteLeft * (normalFrame ? 1 : -1));

Modified: scummvm/trunk/engines/m4/graphics.h
===================================================================
--- scummvm/trunk/engines/m4/graphics.h	2010-06-15 11:06:14 UTC (rev 49800)
+++ scummvm/trunk/engines/m4/graphics.h	2010-06-15 11:19:32 UTC (rev 49801)
@@ -157,10 +157,9 @@
 	void reset();
 	void frameRect(const Common::Rect &r, uint8 color);
 	void fillRect(const Common::Rect &r, uint8 color);
-	void copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY, 
-			int transparentColour = -1);
-	void copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surface *depthSurface, int scale,
-			int transparentColour = -1);
+	void copyFrom(M4Surface *src, const Common::Rect &srcBounds, int destX, int destY, int transparentColour = -1);
+	void copyFrom(M4Surface *src, int destX, int destY, Common::Point destAdjust, int depth, M4Surface *depthSurface, 
+			int scale, int transparentColour = -1);
 
 	void update() {
 		if (_isScreen) {
@@ -182,7 +181,7 @@
 	}
 	inline void copyTo(M4Surface *dest, int destX, int destY, int depth, M4Surface *depthsSurface, int scale,
 				int transparentColour = -1) {
-		dest->copyFrom(this, destX, destY, depth, depthsSurface, scale, transparentColour);
+		dest->copyFrom(this, destX, destY, Common::Point(0, 0), depth, depthsSurface, scale, transparentColour);
 	}
 
 	void scrollX(int xAmount);

Modified: scummvm/trunk/engines/m4/mads_views.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_views.cpp	2010-06-15 11:06:14 UTC (rev 49800)
+++ scummvm/trunk/engines/m4/mads_views.cpp	2010-06-15 11:19:32 UTC (rev 49801)
@@ -196,7 +196,7 @@
 			// Minimalised drawing
 			assert(slot.spriteListIndex < (int)_sprites.size());
 			M4Sprite *spr = spriteSet.getFrame((slot.frameNumber & 0x7fff) - 1);
-			spr->copyTo(view, slot.xp, slot.yp + yOffset, slot.depth, _owner._depthSurface, slot.scale, 0);
+			view->copyFrom(spr, slot.xp, slot.yp, Common::Point(0, yOffset), slot.depth, _owner._depthSurface, slot.scale, 0);
 		} else {
 			int xp, yp;
 			M4Sprite *spr = spriteSet.getFrame(slot.frameNumber - 1);
@@ -211,7 +211,7 @@
 
 			if (slot.depth > 1) {
 				// Draw the frame with depth processing
-				spr->copyTo(view, xp, yp + yOffset, slot.depth, _owner._depthSurface, 100, 0);
+				view->copyFrom(spr, xp, yp, Common::Point(0, yOffset), slot.depth, _owner._depthSurface, 100, 0);
 			} else {
 				// No depth, so simply draw the image
 				spr->copyTo(view, xp, yp + yOffset, 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