aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/picture.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-02-01 00:53:13 +0000
committerMatthew Hoops2010-02-01 00:53:13 +0000
commit313b531d56d4accb89bcf65c72a37480c1fc052c (patch)
tree6da539b314bd108848a7cb1396e03597da6576a6 /engines/sci/graphics/picture.cpp
parentda1a125a1ade505a061c150e57e518f11993edc0 (diff)
downloadscummvm-rg350-313b531d56d4accb89bcf65c72a37480c1fc052c.tar.gz
scummvm-rg350-313b531d56d4accb89bcf65c72a37480c1fc052c.tar.bz2
scummvm-rg350-313b531d56d4accb89bcf65c72a37480c1fc052c.zip
Skip extra pixels at the end of each row in the cel so that they don't carry over to the next row if the dest width is less than the source width. Fixes several images in Mixed-Up Mother Goose (SCI1).
svn-id: r47788
Diffstat (limited to 'engines/sci/graphics/picture.cpp')
-rw-r--r--engines/sci/graphics/picture.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index 1a2ae01c67..96683ba344 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -295,9 +295,14 @@ void SciGuiPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rle
curByte = *ptr++;
if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+
x++;
+
if (x >= rightX) {
- x = leftX; y++;
+ if (width > rightX - leftX) // Skip extra pixels at the end of the row
+ ptr += width - (rightX - leftX);
+ x = leftX;
+ y++;
}
}
} else {
@@ -307,12 +312,18 @@ void SciGuiPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rle
curByte = *ptr++;
if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+
if (x == leftX) {
- x = rightX; y++;
+ if (width > rightX - leftX) // Skip extra pixels at the end of the row
+ ptr += width - (rightX - leftX);
+ x = rightX;
+ y++;
}
+
x--;
}
}
+
delete[] celBitmap;
}