From d08df2683dfadea4ad69cab4f88ae6513ffec635 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Tue, 31 Jan 2006 19:28:19 +0000 Subject: Use the pitch of a virtual screen surface instead of the width to skip a scanline. svn-id: r20334 --- scumm/wiz_he.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 18efc5b94c..f26a442756 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -1246,7 +1246,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int uint8 *srcWizBuf = drawWizImage(resNum, state, 0, 0, 0, shadow, 0, r, kWIFBlitToMemBuffer, 0, palette); if (srcWizBuf) { uint8 *dst; - int32 dstw, dsth, wizW, wizH; + int32 dstw, dsth, dstpitch, wizW, wizH; VirtScreen *pvs = &_vm->virtscr[kMainVirtScreen]; int transColor = (_vm->VAR_WIZ_TCOLOR != 0xFF) ? _vm->VAR(_vm->VAR_WIZ_TCOLOR) : 5; @@ -1256,6 +1256,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int dst = _vm->findWrappedBlock(MKID('WIZD'), dstPtr, 0, 0); assert(dst); getWizImageDim(dstResNum, 0, dstw, dsth); + dstpitch = dstw; } else { if (flags & kWIFMarkBufferDirty) { dst = pvs->getPixels(0, 0); @@ -1264,6 +1265,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int } dstw = pvs->w; dsth = pvs->h; + dstpitch = pvs->pitch; } getWizImageDim(resNum, state, wizW, wizH); @@ -1318,7 +1320,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int pdd.rAreasNum = 0; PolygonDrawData::ResultArea *pra = &pdd.ra[0]; - int32 yoff = pdd.mat[0].y * dstw; + int32 yoff = pdd.mat[0].y * dstpitch; int16 y_start = pdd.mat[0].y; for (i = 0; i < pdd.pAreasNum; ++i) { PolygonDrawData::PolygonArea *ppa = &pdd.pa[i]; @@ -1350,7 +1352,7 @@ void Wiz::drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int } } ++ppa; - yoff += dstw; + yoff += dstpitch; ++y_start; } -- cgit v1.2.3