diff options
author | James Brown | 2002-11-08 18:40:12 +0000 |
---|---|---|
committer | James Brown | 2002-11-08 18:40:12 +0000 |
commit | 6e4bc05791b95c93bc824df5bd1d3fbf9e345996 (patch) | |
tree | 5ec6bfd7060a85e11444b0674f23669993adec7a | |
parent | 1bf9bb768ed3d6ef438c8ff81b5cceffd01a6232 (diff) | |
download | scummvm-rg350-6e4bc05791b95c93bc824df5bd1d3fbf9e345996.tar.gz scummvm-rg350-6e4bc05791b95c93bc824df5bd1d3fbf9e345996.tar.bz2 scummvm-rg350-6e4bc05791b95c93bc824df5bd1d3fbf9e345996.zip |
Masking patch
svn-id: r5468
-rw-r--r-- | scumm/akos.cpp | 3 | ||||
-rw-r--r-- | scumm/gfx.cpp | 16 | ||||
-rw-r--r-- | scumm/scumm.h | 1 |
3 files changed, 13 insertions, 7 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index 8f74f57e9a..6e27eaf66a 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -923,8 +923,7 @@ void AkosRenderer::codec5() { bdd.y = _y + move_y_cur; if (clipping != 0) { - _vm->_bompMaskPtr = _vm->getResourceAddress(rtBuffer, 9) + _vm->_screenStartStrip + _vm->gdi._imgBufOffs[clipping]; - _vm->_bompMaskPitch = _vm->_realWidth / 8; + _vm->_bompMaskPtr = _vm->getResourceAddress(rtBuffer, 9) + _vm->gdi._imgBufOffs[clipping]; _vm->drawBomp(&bdd, decode_mode, 1); } else { _vm->drawBomp(&bdd, decode_mode, 0); diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 3fef4a947b..77f62b4695 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -3260,8 +3260,9 @@ void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { byte skip_y_new = 0; byte bits = 0; byte *mask_out = 0; + byte *charset_mask; byte tmp; - int32 clip_left, clip_right, clip_top, clip_bottom, tmp_x, tmp_y; + int32 clip_left, clip_right, clip_top, clip_bottom, tmp_x, tmp_y, mask_offset, mask_pitch; if (bd->x < 0) { clip_left = -bd->x; @@ -3290,9 +3291,14 @@ void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { byte * src = bd->dataptr; byte * dst = bd->out + bd->y * bd->outwidth + bd->x + clip_left; + mask_pitch = _realWidth / 8; + mask_offset = _screenStartStrip + (bd->y * mask_pitch) + ((bd->x + clip_left) >> 3); + + charset_mask = getResourceAddress(rtBuffer, 9) + mask_offset; + bits = 128 >> ((bd->x + clip_left) & 7); + if (mask == 1) { - mask_out = _bompMaskPtr + (bd->y * _bompMaskPitch) + ((bd->x + clip_left) >> 3); - bits = 128 >> ((bd->x + clip_left) & 7); + mask_out = _bompMaskPtr + mask_offset; } if (mask == 3) { @@ -3358,6 +3364,7 @@ void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { bompApplyMask(line_ptr, mask_out, bits, clip_right); } + bompApplyMask(line_ptr, charset_mask, bits, clip_right); bompApplyActorPalette(line_ptr, clip_right); switch(bd->shadowMode) { @@ -3375,7 +3382,8 @@ void Scumm::drawBomp(BompDrawData * bd, int decode_mode, int mask) { } labelBompSkip: - mask_out += _bompMaskPitch; + mask_out += mask_pitch; + charset_mask += mask_pitch; pos_y++; dst += bd->outwidth; if (pos_y >= clip_bottom) diff --git a/scumm/scumm.h b/scumm/scumm.h index 2c934640cb..5e2ff313f9 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -816,7 +816,6 @@ public: int32 _bompScaleRight, _bompScaleBottom; byte *_bompScallingXPtr, *_bompScallingYPtr; byte *_bompMaskPtr; - int32 _bompMaskPitch; byte *_bompActorPalletePtr; |