diff options
author | Eugene Sandulenko | 2016-05-02 10:32:50 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-02 10:32:50 +0200 |
commit | 521b0794950c0be6f40ff4f24ea649b2c11b718d (patch) | |
tree | db5867713dc1929579ac0ff85d196bfec968650f | |
parent | 052f52747a8a1e40def138355906fbf0260df89b (diff) | |
download | scummvm-rg350-521b0794950c0be6f40ff4f24ea649b2c11b718d.tar.gz scummvm-rg350-521b0794950c0be6f40ff4f24ea649b2c11b718d.tar.bz2 scummvm-rg350-521b0794950c0be6f40ff4f24ea649b2c11b718d.zip |
SCUMM HE: Fix T14 output positions
-rw-r--r-- | engines/scumm/he/moonbase/moonbase.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp index 4ddaa43f81..a24d1463e3 100644 --- a/engines/scumm/he/moonbase/moonbase.cpp +++ b/engines/scumm/he/moonbase/moonbase.cpp @@ -38,7 +38,8 @@ void Moonbase::renderFOW() { } void Moonbase::blitT14WizImage(uint8 *dst, int dstw, int dsth, int dstPitch, const Common::Rect *clipBox, - uint8 *wizd, int srcx, int srcy, int rawROP, int paramROP) { + uint8 *wizd, int dstx, int dsty, int rawROP, int paramROP) { + Common::Rect rScreen(dstw, dsth); if (clipBox) { Common::Rect clip(clipBox->left, clipBox->top, clipBox->right, clipBox->bottom); @@ -49,7 +50,10 @@ void Moonbase::blitT14WizImage(uint8 *dst, int dstw, int dsth, int dstPitch, con } } - dst += clipBox->top * dstPitch + clipBox->left * 2; + int srcx = 0; + int srcy = 0; + + dst += dsty * dstPitch + dstx * 2; int width = READ_LE_UINT16(wizd + 0x8 + 0); int height = READ_LE_UINT16(wizd + 0x8 + 2); @@ -62,6 +66,13 @@ void Moonbase::blitT14WizImage(uint8 *dst, int dstw, int dsth, int dstPitch, con uint8 *singlesOffset = READ_LE_UINT16(dataPointer + 2) + dataPointer; uint8 *quadsOffset = READ_LE_UINT16(dataPointer + 4) + dataPointer; + if (i < srcy) { + dataPointer += lineSize; + dst += dstPitch; + + continue; + } + int pixels = width; byte *dst1 = dst; byte *codes = dataPointer + 6; @@ -72,15 +83,19 @@ void Moonbase::blitT14WizImage(uint8 *dst, int dstw, int dsth, int dstPitch, con if (code == 0) { // quad for (int c = 0; c < 4; c++) { - WRITE_LE_UINT16(dst1, READ_LE_UINT16(quadsOffset)); + if (width - pixels >= srcx) { + WRITE_LE_UINT16(dst1, READ_LE_UINT16(quadsOffset)); + dst1 += 2; + } quadsOffset += 2; - dst1 += 2; pixels--; } } else if (code < 0) { // single - WRITE_LE_UINT16(dst1, READ_LE_UINT16(singlesOffset)); + if (width - pixels >= srcx) { + WRITE_LE_UINT16(dst1, READ_LE_UINT16(singlesOffset)); + dst1 += 2; + } singlesOffset += 2; - dst1 += 2; pixels--; } else { // skip if ((code & 1) == 0) { @@ -88,10 +103,12 @@ void Moonbase::blitT14WizImage(uint8 *dst, int dstw, int dsth, int dstPitch, con dst1 += code * 2; pixels -= code; } else { // special case - uint16 color = READ_LE_UINT16(singlesOffset); - WRITE_LE_UINT16(dst1, color); + if (width - pixels >= srcx) { + uint16 color = READ_LE_UINT16(singlesOffset); + WRITE_LE_UINT16(dst1, color); + dst1 += 2; + } singlesOffset += 2; - dst1 += 2; pixels--; } } |