diff options
author | Travis Howell | 2009-06-13 13:59:41 +0000 |
---|---|---|
committer | Travis Howell | 2009-06-13 13:59:41 +0000 |
commit | e6f874ee9508a6631635504808680e50a4f55c7f (patch) | |
tree | 69be45a074d3d4a88bc248534fd06ec5ee8743d4 /engines/scumm/he | |
parent | 350dc4290fd5dd8f28af9e63713b48ef2c131f09 (diff) | |
download | scummvm-rg350-e6f874ee9508a6631635504808680e50a4f55c7f.tar.gz scummvm-rg350-e6f874ee9508a6631635504808680e50a4f55c7f.tar.bz2 scummvm-rg350-e6f874ee9508a6631635504808680e50a4f55c7f.zip |
Fix possible endian issues.
svn-id: r41494
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/wiz_he.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 4661bb649c..deaf7aaf72 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -1152,7 +1152,10 @@ static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common if (dst) { src += rCapt.top * srcPitch + rCapt.left * 2; while (h--) { - memcpy(dst, src, w * 2); + for (int i = 0; i < w; i++) { + uint16 col = READ_UINT16(src + w * 2); + WRITE_LE_UINT16(dst + w * 2, col); + } dst += w * 2; src += srcPitch; } @@ -1734,7 +1737,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int if (srcWizBuf) { uint8 *dst; - int32 dstw, dsth, dstpitch, wizW, wizH; + int32 dstw, dsth, dstpitch, dstType, wizW, wizH; VirtScreen *pvs = &_vm->_virtscr[kMainVirtScreen]; int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5; @@ -1745,6 +1748,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int assert(dst); getWizImageDim(dstResNum, 0, dstw, dsth); dstpitch = dstw * _vm->_bitDepth; + dstType = kDstResource; } else { if (flags & kWIFMarkBufferDirty) { dst = pvs->getPixels(0, 0); @@ -1754,6 +1758,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int dstw = pvs->w; dsth = pvs->h; dstpitch = pvs->pitch; + dstType = kDstScreen; } getWizImageDim(resNum, state, wizW, wizH); @@ -1857,7 +1862,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int y_acc += pra->y_step; if (_vm->_bitDepth == 2) { if (transColor == -1 || transColor != READ_LE_UINT16(srcWizBuf + src_offs * 2)) - WRITE_LE_UINT16(dstPtr, READ_LE_UINT16(srcWizBuf + src_offs * 2)); + writeColor(dstPtr, dstType, READ_LE_UINT16(srcWizBuf + src_offs * 2)); } else { if (transColor == -1 || transColor != srcWizBuf[src_offs]) *dstPtr = srcWizBuf[src_offs]; |