diff options
author | Tobia Tesan | 2013-08-14 16:55:50 +0200 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-08-16 00:44:27 +0200 |
commit | a653ae20d59efe4260d3e2febdf4533943027d00 (patch) | |
tree | e667fd0321d0e5519c99129acdde308b966481ac /engines/wintermute/graphics/transparent_surface.cpp | |
parent | 21314e2389dfe4fa7f7cacc94fa2b99421fe4a66 (diff) | |
download | scummvm-rg350-a653ae20d59efe4260d3e2febdf4533943027d00.tar.gz scummvm-rg350-a653ae20d59efe4260d3e2febdf4533943027d00.tar.bz2 scummvm-rg350-a653ae20d59efe4260d3e2febdf4533943027d00.zip |
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
Diffstat (limited to 'engines/wintermute/graphics/transparent_surface.cpp')
-rw-r--r-- | engines/wintermute/graphics/transparent_surface.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp index df6286e37a..e375322ae9 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(); |