diff options
author | Paul Gilbert | 2014-11-28 10:19:26 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:50:03 -0500 |
commit | 62a7619017c676c229ba72b295a4ceae19d3f0c7 (patch) | |
tree | 371b6de7b51418d7d37f413f6ed069c22c044d7b /engines/access | |
parent | 27351011799b4c85e0fc7f80acbbbf10dbb78aa9 (diff) | |
download | scummvm-rg350-62a7619017c676c229ba72b295a4ceae19d3f0c7.tar.gz scummvm-rg350-62a7619017c676c229ba72b295a4ceae19d3f0c7.tar.bz2 scummvm-rg350-62a7619017c676c229ba72b295a4ceae19d3f0c7.zip |
ACCESS: Better fix for drawing partially off-screen sprites
Diffstat (limited to 'engines/access')
-rw-r--r-- | engines/access/asurface.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp index 624721920a..4202ed098f 100644 --- a/engines/access/asurface.cpp +++ b/engines/access/asurface.cpp @@ -232,33 +232,34 @@ void ASurface::copyTo(ASurface *dest, const Common::Rect &bounds) { scaleYCtr -= SCALE_LIMIT; // Handle off-screen lines - if (destY < 0) - continue; - else if (destY >= dest->h) + if (destY >= dest->h) break; - // Handle drawing the line - byte *pSrc = (byte *)getBasePtr(0, yCtr); - byte *pDest = (byte *)dest->getBasePtr(bounds.left, destY); - scaleXCtr = 0; - int x = bounds.left; - - for (int xCtr = 0; xCtr < this->w; ++xCtr, ++pSrc) { - // Handle horizontal scaling - scaleXCtr += scaleX; - if (scaleXCtr < SCALE_LIMIT) - continue; - scaleXCtr -= SCALE_LIMIT; - - // Only handle on-screen pixels - if (x >= dest->w) - break; - if (x >= 0 && *pSrc != 0) - *pDest = *pSrc; - - ++pDest; - ++x; + if (destY >= 0) { + // Handle drawing the line + byte *pSrc = (byte *)getBasePtr(0, yCtr); + byte *pDest = (byte *)dest->getBasePtr(bounds.left, destY); + scaleXCtr = 0; + int x = bounds.left; + + for (int xCtr = 0; xCtr < this->w; ++xCtr, ++pSrc) { + // Handle horizontal scaling + scaleXCtr += scaleX; + if (scaleXCtr < SCALE_LIMIT) + continue; + scaleXCtr -= SCALE_LIMIT; + + // Only handle on-screen pixels + if (x >= dest->w) + break; + if (x >= 0 && *pSrc != 0) + *pDest = *pSrc; + + ++pDest; + ++x; + } } + ++destY; } } |