From deb907de637b963af91aa530251fad5ad6b45025 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 15 Jun 2010 11:19:32 +0000 Subject: Bugfixes to depth processing that was causing the 'Microprose Design Group' message not to appear in the first intro scene svn-id: r49801 --- engines/m4/graphics.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/m4/graphics.cpp') diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp index 36de60af6c..d7a0c9edfc 100644 --- a/engines/m4/graphics.cpp +++ b/engines/m4/graphics.cpp @@ -400,8 +400,8 @@ void M4Surface::copyFrom(M4Surface *src, const Common::Rect &srcBounds, int dest * 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 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surf 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 @@ void M4Surface::copyFrom(M4Surface *src, int destX, int destY, int depth, M4Surf 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)); -- cgit v1.2.3