diff options
author | Travis Howell | 2005-04-27 09:15:18 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-27 09:15:18 +0000 |
commit | 7c11e68db351c9901e85cfc76ec934adc1048c7b (patch) | |
tree | f25d4bb91c86041988448dc28797c2a96b2fb239 | |
parent | 3a4c1f057ec070d579d0be4307dc95afbdfb3160 (diff) | |
download | scummvm-rg350-7c11e68db351c9901e85cfc76ec934adc1048c7b.tar.gz scummvm-rg350-7c11e68db351c9901e85cfc76ec934adc1048c7b.tar.bz2 scummvm-rg350-7c11e68db351c9901e85cfc76ec934adc1048c7b.zip |
Correct actor clipping in HE games.
The original games rect clipping was not as strict.
svn-id: r17835
-rw-r--r-- | scumm/akos.cpp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 9bda00fce9..9e25d43e2e 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -308,7 +308,6 @@ void AkosRenderer::setPalette(byte *new_palette) { } } - if (_vm->_heversion == 70) { for (i = 0; i < size; i++) palette[i] = _vm->_HEV7ActorPalette[palette[i]]; @@ -869,8 +868,22 @@ byte AkosRenderer::codec1(int xmoveCur, int ymoveCur) { v1.scaleXstep = _mirror ? 1 : -1; if (_vm->_heversion >= 71) { - if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) - rect.clip(_clipOverride); + if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) { + if (rect.left < _clipOverride.left) + rect.left = _clipOverride.left; + + if (rect.right > _clipOverride.right) + rect.right = _clipOverride.right; + + if (rect.top < _clipOverride.top) + rect.top = _clipOverride.top; + + if (rect.bottom > _clipOverride.bottom) + rect.bottom = _clipOverride.bottom; + } + + if (rect.isValidRect() == false) + return 1; } if (_actorHitMode) { @@ -1140,8 +1153,22 @@ byte AkosRenderer::codec16(int xmoveCur, int ymoveCur) { maxh = _out.h; if (_vm->_heversion >= 71) { - if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) - clip.clip(_clipOverride); + if (_clipOverride.right > _clipOverride.left && _clipOverride.bottom > _clipOverride.top) { + if (clip.left < _clipOverride.left) + clip.left = _clipOverride.left; + + if (clip.right > _clipOverride.right) + clip.right = _clipOverride.right; + + if (clip.top < _clipOverride.top) + clip.top = _clipOverride.top; + + if (clip.bottom > _clipOverride.bottom) + clip.bottom = _clipOverride.bottom; + } + + if (clip.isValidRect() == false) + return 0; } markRectAsDirty(clip); @@ -1258,6 +1285,9 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) { dst.bottom -= diff; } + if (dst.isValidRect() == false) + return 0; + markRectAsDirty(dst); if (_draw_top > dst.top) |