From a653ae20d59efe4260d3e2febdf4533943027d00 Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Wed, 14 Aug 2013 16:55:50 +0200 Subject: [PATCH] WINTERMUTE: Fix offset calculation with partial rects when sprites are mirrored. This fixes the dress bug, aka Rosemary appearing "jigsawed" when passing over her with the cursor when she is facing east. See bug #3592907 --- .../wintermute/graphics/transparent_surface.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index df6286e37a1e..e375322ae9d0 100644 --- a/engines/wintermute/graphics/transparent_surface.cpp +++ b/engines/wintermute/graphics/transparent_surface.cpp @@ -309,7 +309,19 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p } if (pPartRect) { - srcImage.pixels = getBasePtr(pPartRect->left, pPartRect->top); + + int xOffset = pPartRect->left; + int yOffset = pPartRect->top; + + if (flipping & FLIP_V) { + yOffset = srcImage.h - pPartRect->bottom; + } + + if (flipping & FLIP_H) { + xOffset = srcImage.w - pPartRect->right; + } + + srcImage.pixels = getBasePtr(xOffset, yOffset); srcImage.w = pPartRect->width(); srcImage.h = pPartRect->height();