From 7658821afd7a6d2e70286866c15eff7dd2618115 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 15 Feb 2015 08:10:13 -0500 Subject: MADS: Fix left screen clipping for scaled flipped sprites --- engines/mads/msurface.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'engines/mads/msurface.cpp') diff --git a/engines/mads/msurface.cpp b/engines/mads/msurface.cpp index cc12442db1..702b9e5f08 100644 --- a/engines/mads/msurface.cpp +++ b/engines/mads/msurface.cpp @@ -400,14 +400,16 @@ void MSurface::copyFrom(MSurface *src, const Common::Point &destPos, int depth, const byte *srcP = srcPixelsP; byte *destP = destPixelsP; - for (int xp = 0, sprX = 0; xp < frameWidth; ++xp, ++srcP) { - if (xp < spriteLeft) - // Not yet reached start of display area - continue; - if (!lineDist[sprX++]) + for (int xp = 0, sprX = -1; xp < frameWidth; ++xp, ++srcP) { + if (!lineDist[xp]) // Not a display pixel continue; + ++sprX; + if (sprX < spriteLeft || sprX >= spriteRight) + // Skip pixel if it's not in horizontal display portion + continue; + // Get depth of current output pixel in depth surface Common::Point pt((destP - (byte *)this->pixels) % this->pitch, (destP - (byte *)this->pixels) / this->pitch); -- cgit v1.2.3