aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/msurface.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-02-15 08:10:13 -0500
committerPaul Gilbert2015-02-15 08:10:13 -0500
commit7658821afd7a6d2e70286866c15eff7dd2618115 (patch)
treebc7de9554fc89848c6929fc0e5d93c9d9f02da1c /engines/mads/msurface.cpp
parent51561c80c0002ea3f59bc513592f04c656d32a65 (diff)
downloadscummvm-rg350-7658821afd7a6d2e70286866c15eff7dd2618115.tar.gz
scummvm-rg350-7658821afd7a6d2e70286866c15eff7dd2618115.tar.bz2
scummvm-rg350-7658821afd7a6d2e70286866c15eff7dd2618115.zip
MADS: Fix left screen clipping for scaled flipped sprites
Diffstat (limited to 'engines/mads/msurface.cpp')
-rw-r--r--engines/mads/msurface.cpp12
1 files changed, 7 insertions, 5 deletions
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);