From e28aa3af79f3ec1ccf30e4e0f69a564a0bfc9247 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 6 Jun 2015 14:31:19 -0400 Subject: SHERLOCK: Properly handle horizontal flipping in transBlitFrom --- engines/sherlock/surface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines') 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); } } -- cgit v1.2.3