diff options
author | Paul Gilbert | 2014-11-26 20:39:36 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:47:44 -0500 |
commit | 89b20c618f16f1d3ad8e33819dd9202d234aa258 (patch) | |
tree | 6530a765049ff1f08e01276ea0383fbf7fec3872 | |
parent | d8c97d259bc19f22ecf8b1cc9da03c374a3adbec (diff) | |
download | scummvm-rg350-89b20c618f16f1d3ad8e33819dd9202d234aa258.tar.gz scummvm-rg350-89b20c618f16f1d3ad8e33819dd9202d234aa258.tar.bz2 scummvm-rg350-89b20c618f16f1d3ad8e33819dd9202d234aa258.zip |
ACCESS: Fix to correctly draw partly off-screen sprites
-rw-r--r-- | engines/access/asurface.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index 96cb1991be..e954e9efa6 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -224,7 +224,7 @@ void ASurface::copyTo(ASurface *dest, const Common::Rect &bounds) { int scaleY = SCALE_LIMIT * bounds.height() / this->h; int scaleXCtr = 0, scaleYCtr = 0; - for (int yCtr = 0, y = bounds.top; yCtr < this->h; ++yCtr) { + for (int yCtr = 0, destY = bounds.top; yCtr < this->h; ++yCtr, ++destY) { // Handle skipping lines if Y scaling scaleYCtr += scaleY; if (scaleYCtr < SCALE_LIMIT) @@ -232,14 +232,14 @@ void ASurface::copyTo(ASurface *dest, const Common::Rect &bounds) { scaleYCtr -= SCALE_LIMIT; // Handle off-screen lines - if (y < 0) + if (destY < 0) continue; - else if (y >= dest->h) + else if (destY >= dest->h) break; // Handle drawing the line byte *pSrc = (byte *)getBasePtr(0, yCtr); - byte *pDest = (byte *)dest->getBasePtr(bounds.left, y); + byte *pDest = (byte *)dest->getBasePtr(bounds.left, destY); scaleXCtr = 0; int x = bounds.left; @@ -259,8 +259,6 @@ void ASurface::copyTo(ASurface *dest, const Common::Rect &bounds) { ++pDest; ++x; } - - ++y; } } |