From d2b47ee775b41779427be111f7a755ee7e796a4b Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 13 Jul 2010 15:42:59 +0000 Subject: SCI: change handling of priority in combination with embedded cels inside picture resources, change in r49029 was wrong - fixes pq1 (map not changing when driving car) svn-id: r50845 --- engines/sci/graphics/picture.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sci/graphics/picture.cpp') diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 7cd37b6f46..5c3330ab7a 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -307,6 +307,8 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos if (!_addToFlag) clearColor = _screen->getColorWhite(); + byte drawMask = priority == 255 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY; + ptr = celBitmap; if (!_mirroredFlag) { // Draw bitmap to screen @@ -314,7 +316,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos while (y < lastY) { curByte = *ptr++; if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) - _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY, curByte, priority, 0); + _screen->putPixel(x, y, drawMask, curByte, priority, 0); x++; @@ -331,7 +333,7 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos while (y < lastY) { curByte = *ptr++; if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) - _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL | GFX_SCREEN_MASK_PRIORITY, curByte, priority, 0); + _screen->putPixel(x, y, drawMask, curByte, priority, 0); if (x == leftX) { if (width > rightX - leftX) // Skip extra pixels at the end of the row @@ -658,8 +660,6 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { vectorGetAbsCoordsNoMirror(data, curPos, x, y); size = READ_LE_UINT16(data + curPos); curPos += 2; _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well - if (pic_priority == 255) - _priority = 0; // if priority not set, use priority 0 drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y); curPos += size; break; -- cgit v1.2.3