aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/picture.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-13 15:42:59 +0000
committerMartin Kiewitz2010-07-13 15:42:59 +0000
commitd2b47ee775b41779427be111f7a755ee7e796a4b (patch)
treeb7c975300fe497a5d25e5bc912f6c33086b1a64c /engines/sci/graphics/picture.cpp
parent762c569207f778b5b3efad9414a3cfe943424316 (diff)
downloadscummvm-rg350-d2b47ee775b41779427be111f7a755ee7e796a4b.tar.gz
scummvm-rg350-d2b47ee775b41779427be111f7a755ee7e796a4b.tar.bz2
scummvm-rg350-d2b47ee775b41779427be111f7a755ee7e796a4b.zip
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
Diffstat (limited to 'engines/sci/graphics/picture.cpp')
-rw-r--r--engines/sci/graphics/picture.cpp8
1 files changed, 4 insertions, 4 deletions
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;