From 863bed3fd034ab9e7a93d5426aab5c00297f4340 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Wed, 4 Oct 2006 05:11:58 +0000 Subject: Change masking condition for codec1_genericDecode(), proc3() and proc3_ami() so that X coordinates outside the designated area are explicitly masked. While the functions are written to terminate when X moves outside, bug #1508942 ("FOA: Glitch dring balloon flight") demonstrates that X may *start* outside. That's the case we want to mask. Note that proc3_ami() already masked these pixels (in a different way), so there the change is purely cosmetical. svn-id: r24104 --- engines/scumm/akos.cpp | 2 +- engines/scumm/costume.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/scumm/akos.cpp b/engines/scumm/akos.cpp index 2dfe3f03f1..148c3c0af2 100644 --- a/engines/scumm/akos.cpp +++ b/engines/scumm/akos.cpp @@ -564,7 +564,7 @@ void AkosRenderer::codec1_genericDecode(Codec1 &v1) { return; } } else { - masked = (y < v1.boundsRect.top || y >= v1.boundsRect.bottom) || (*mask & maskbit); + masked = (y < v1.boundsRect.top || y >= v1.boundsRect.bottom) || (v1.x < 0 || v1.x >= v1.boundsRect.right) || (*mask & maskbit); if (color && !masked && !skip_column) { pcolor = palette[color]; diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 5d81cdc441..82201a6017 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -443,7 +443,7 @@ void ClassicCostumeRenderer::proc3(Codec1 &v1) { do { if (_scaleY == 255 || v1.scaletable[scaleIndexY++] < _scaleY) { - masked = (y < 0 || y >= _out.h) || (v1.mask_ptr && (mask[0] & maskbit)); + masked = (y < 0 || y >= _out.h) || (v1.x < 0 || v1.x >= _out.w) || (v1.mask_ptr && (mask[0] & maskbit)); if (color && !masked) { if (_shadow_mode & 0x20) { @@ -510,9 +510,9 @@ void ClassicCostumeRenderer::proc3_ami(Codec1 &v1) { len = *src++; do { if (_scaleY == 255 || v1.scaletable[_scaleIndexY] < _scaleY) { - masked = (y < 0 || y >= _out.h) || (v1.mask_ptr && (mask[0] & maskbit)); + masked = (y < 0 || y >= _out.h) || (v1.x < 0 || v1.x >= _out.w) || (v1.mask_ptr && (mask[0] & maskbit)); - if (color && v1.x >= 0 && v1.x < _out.w && !masked) { + if (color && !masked) { *dst = _palette[color]; } -- cgit v1.2.3