From 313b531d56d4accb89bcf65c72a37480c1fc052c Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 1 Feb 2010 00:53:13 +0000 Subject: 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 --- engines/sci/graphics/picture.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics/picture.cpp') 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; } -- cgit v1.2.3