aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-06 14:31:19 -0400
committerPaul Gilbert2015-06-06 14:31:19 -0400
commite28aa3af79f3ec1ccf30e4e0f69a564a0bfc9247 (patch)
treee11c09d6dbd8954609d0e1ab4d97ae15bacdd90f /engines
parent3fda42fbffdc82ec255b4afe3f8296fc9713bc95 (diff)
downloadscummvm-rg350-e28aa3af79f3ec1ccf30e4e0f69a564a0bfc9247.tar.gz
scummvm-rg350-e28aa3af79f3ec1ccf30e4e0f69a564a0bfc9247.tar.bz2
scummvm-rg350-e28aa3af79f3ec1ccf30e4e0f69a564a0bfc9247.zip
SHERLOCK: Properly handle horizontal flipping in transBlitFrom
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/surface.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sherlock/surface.cpp b/engines/sherlock/surface.cpp
index aba378af65..e456d00e05 100644
--- a/engines/sherlock/surface.cpp
+++ b/engines/sherlock/surface.cpp
@@ -125,11 +125,11 @@ void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &p
if (destY >= 0) {
// Handle drawing the line
- const byte *pSrc = (const byte *)src.getBasePtr(0, yCtr);
+ const byte *pSrc = (const byte *)src.getBasePtr(flipped ? src.w - 1 : 0, yCtr);
byte *pDest = (byte *)getBasePtr(pt.x, destY);
scaleXCtr = 0;
- for (int xCtr = 0, destX = pt.x; xCtr < src.w && destX < this->w(); ++xCtr, ++pSrc) {
+ for (int xCtr = 0, destX = pt.x; xCtr < src.w && destX < this->w(); ++xCtr) {
// Handle horizontal scaling
scaleXCtr += scaleX;
@@ -143,6 +143,8 @@ void Surface::transBlitFrom(const Graphics::Surface &src, const Common::Point &p
++pDest;
++destX;
}
+
+ pSrc = pSrc + (flipped ? -1 : 1);
}
}