[Scummvm-cvs-logs] SF.net SVN: scummvm:[41494] scummvm/branches/gsoc2009-16bit/engines/scumm/ he/wiz_he.cpp
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Sat Jun 13 15:59:42 CEST 2009
Revision: 41494
http://scummvm.svn.sourceforge.net/scummvm/?rev=41494&view=rev
Author: Kirben
Date: 2009-06-13 13:59:41 +0000 (Sat, 13 Jun 2009)
Log Message:
-----------
Fix possible endian issues.
Modified Paths:
--------------
scummvm/branches/gsoc2009-16bit/engines/scumm/he/wiz_he.cpp
Modified: scummvm/branches/gsoc2009-16bit/engines/scumm/he/wiz_he.cpp
===================================================================
--- scummvm/branches/gsoc2009-16bit/engines/scumm/he/wiz_he.cpp 2009-06-13 13:27:21 UTC (rev 41493)
+++ scummvm/branches/gsoc2009-16bit/engines/scumm/he/wiz_he.cpp 2009-06-13 13:59:41 UTC (rev 41494)
@@ -1152,7 +1152,10 @@
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 @@
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 @@
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 @@
dstw = pvs->w;
dsth = pvs->h;
dstpitch = pvs->pitch;
+ dstType = kDstScreen;
}
getWizImageDim(resNum, state, wizW, wizH);
@@ -1857,7 +1862,7 @@
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];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list