aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-04 21:34:12 -0400
committerPaul Gilbert2018-04-04 21:34:12 -0400
commit4352ea6a2300f732e119125b601e01d5089032ad (patch)
tree07ce8a2052a14ff1b647f07409e9a3ba7a36a9df
parenta0d7a99439a9d4d070c5847b489222913ec2c5ce (diff)
downloadscummvm-rg350-4352ea6a2300f732e119125b601e01d5089032ad.tar.gz
scummvm-rg350-4352ea6a2300f732e119125b601e01d5089032ad.tar.bz2
scummvm-rg350-4352ea6a2300f732e119125b601e01d5089032ad.zip
XEEN: Improved clipping for drawing within scene area
-rw-r--r--engines/xeen/sprites.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp
index adeb5671c1..2a5d18e93d 100644
--- a/engines/xeen/sprites.cpp
+++ b/engines/xeen/sprites.cpp
@@ -147,8 +147,7 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi
bounds = Common::Rect(0, 0, dest.w, dest.h);
}
if (flags & SPRFLAG_SCENE_CLIPPED) {
- bounds.top = 8;
- bounds.bottom = 149;
+ bounds.clip(Common::Rect(8, 8, 230, 149));
}
uint16 scaleMaskXCopy = scaleMaskX;
@@ -285,8 +284,7 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi
if (bit) {
// Check whether there's a pixel to write, and we're within the allowable bounds. Note that for
// the SPRFLAG_SCENE_CLIPPED or when enlarging, we also have an extra horizontal bounds check
- if (*lineP != -1 && xp >= bounds.left && xp < bounds.right &&
- ((!(flags & SPRFLAG_SCENE_CLIPPED) && !enlarge) || (xp >= SCENE_CLIP_LEFT && xp < SCENE_CLIP_RIGHT))) {
+ if (*lineP != -1 && xp >= bounds.left && xp < bounds.right) {
drawBounds.left = MIN(drawBounds.left, xp);
drawBounds.right = MAX((int)drawBounds.right, xp + 1);
*destP = (byte)*lineP;