aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/graphics.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2010-06-15 11:19:32 +0000
committerPaul Gilbert2010-06-15 11:19:32 +0000
commitdeb907de637b963af91aa530251fad5ad6b45025 (patch)
treeb3d8d7e8fdfc8aabf4fc89d089f763e96bca07e7 /engines/m4/graphics.cpp
parentab901bccd06ea88fdd7c16f77e8f7e437092e9eb (diff)
downloadscummvm-rg350-deb907de637b963af91aa530251fad5ad6b45025.tar.gz
scummvm-rg350-deb907de637b963af91aa530251fad5ad6b45025.tar.bz2
scummvm-rg350-deb907de637b963af91aa530251fad5ad6b45025.zip
Bugfixes to depth processing that was causing the 'Microprose Design Group' message not to appear in the first intro scene
svn-id: r49801
Diffstat (limited to 'engines/m4/graphics.cpp')
-rw-r--r--engines/m4/graphics.cpp10
1 files changed, 5 insertions, 5 deletions
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));