diff options
author | Travis Howell | 2005-11-05 13:05:52 +0000 |
---|---|---|
committer | Travis Howell | 2005-11-05 13:05:52 +0000 |
commit | b8aaa2ed04d00e7937111735aaa845864f6aee98 (patch) | |
tree | a07dc3c76e226c5a0647e0ba8a4bc96f99d5d159 | |
parent | 2dbaa1037d6153f9cbbe13499c5ae723ab23f29b (diff) | |
download | scummvm-rg350-b8aaa2ed04d00e7937111735aaa845864f6aee98.tar.gz scummvm-rg350-b8aaa2ed04d00e7937111735aaa845864f6aee98.tar.bz2 scummvm-rg350-b8aaa2ed04d00e7937111735aaa845864f6aee98.zip |
Detect where wizImage type 1 should be flipped.
Show images without zoom or angle in ski ride of pajama3 for now.
svn-id: r19462
-rw-r--r-- | scumm/akos.cpp | 4 | ||||
-rw-r--r-- | scumm/charset.cpp | 2 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 38 | ||||
-rw-r--r-- | scumm/wiz_he.h | 4 |
4 files changed, 31 insertions, 17 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index caecbdbca8..e5655a6ae1 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -1334,9 +1334,9 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) { byte *dstPtr = (byte *)_out.pixels + dst.left + dst.top * _out.pitch; if (_shadow_mode == 3) { - Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr, xmap); + Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, 0, palPtr, xmap); } else { - Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr); + Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, 0, palPtr); } #endif return 0; diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 0cb3310f41..f94470b2b2 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1427,7 +1427,7 @@ void CharsetRendererClassic::printChar(int chr) { byte imagePalette[256]; memset(imagePalette, 0, sizeof(imagePalette)); memcpy(imagePalette, _vm->_charsetColorMap, 16); - Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, imagePalette); + Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, imagePalette); } else { Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen); } diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index c8dc116297..408e9544c4 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -311,11 +311,11 @@ static bool calcClipRects(int dst_w, int dst_h, int src_x, int src_y, int src_w, return srcRect.isValidRect() && dstRect.isValidRect(); } -void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, const uint8 *palPtr, const uint8 *xmapPtr) { +void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) { Common::Rect r1, r2; if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) { dst += r2.left + r2.top * dstw; - decompressWizImage(dst, dstw, r2, src, r1, palPtr, xmapPtr); + decompressWizImage(dst, dstw, r2, src, r1, flags, palPtr, xmapPtr); } } @@ -406,7 +406,14 @@ void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int } } -void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, const uint8 *palPtr, const uint8 *xmapPtr) { +void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) { + if (flags & kWIFFlipX) { + debug(0, "decompressWizImage: Unhandled flag kWIFFlipX"); + } + if (flags & kWIFFlipY) { + debug(0, "decompressWizImage: Unhandled flag kWIFFlipY"); + } + const uint8 *dataPtr, *dataPtrNext; uint8 *dstPtr, *dstPtrNext; uint32 code; @@ -1059,14 +1066,14 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int x1, int y1, int zorder, int break; case 1: // TODO Adding masking for flags 0x80 and 0x100 - if (flags & 0x80) { + if (flags & 0x80) // Used in maze debug(0, "drawWizImage: Unhandled flag 0x80"); - } else if (flags & 0x100) { + if (flags & 0x100) { // Used in readdemo debug(0, "drawWizImage: Unhandled flag 0x100"); } - copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, palPtr, xmapPtr); + copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr); break; case 2: copyRaw16BitWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, color); @@ -1181,10 +1188,16 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int s pts[i].y += po_y; } + Common::Rect bounds; + polygonCalcBoundBox(pts, 4, bounds); + int x1 = bounds.left; + int y1 = bounds.top; + if (scale != 256) { debug(1, "drawWizComplexPolygon() scale not implemented"); - //drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstPtr, palette, xmapPtr); + + drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); } else { debug(1, "drawWizComplexPolygon() angle partially implemented"); @@ -1193,15 +1206,12 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int s angle += 360; } - Common::Rect bounds; - polygonCalcBoundBox(pts, 4, bounds); - int x1 = bounds.left; - int y1 = bounds.top; - switch(angle) { case 270: flags |= kWIFFlipX | kWIFFlipY; //drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, palette); + + drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); break; case 180: flags |= kWIFFlipX | kWIFFlipY; @@ -1209,12 +1219,16 @@ void Wiz::drawWizComplexPolygon(int resNum, int state, int po_x, int po_y, int s break; case 90: //drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, palette); + + drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); break; case 0: drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); break; default: //drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstResNum, palette, xmapPtr); + + drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette); break; } } diff --git a/scumm/wiz_he.h b/scumm/wiz_he.h index 0cdb558fe4..59b216e666 100644 --- a/scumm/wiz_he.h +++ b/scumm/wiz_he.h @@ -187,10 +187,10 @@ public: void processWizImage(const WizParameters *params); static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch); - static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); + static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor); static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor); - static void decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); + static void decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL); int isWizPixelNonTransparent(const uint8 *data, int x, int y, int w, int h); uint8 getWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 color); uint8 getRawWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 color); |