Skip to content

Commit

Permalink
WINTERMUTE: Fix offset calculation with partial rects when sprites ar…
Browse files Browse the repository at this point in the history
…e 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
  • Loading branch information
tobiatesan authored and wjp committed Aug 15, 2013
1 parent 21314e2 commit a653ae2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion engines/wintermute/graphics/transparent_surface.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit a653ae2

Please sign in to comment.