From 4352ea6a2300f732e119125b601e01d5089032ad Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 4 Apr 2018 21:34:12 -0400 Subject: XEEN: Improved clipping for drawing within scene area --- engines/xeen/sprites.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines') 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; -- cgit v1.2.3