aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-14 09:46:02 +0000
committerMartin Kiewitz2009-10-14 09:46:02 +0000
commit4c91ace5307e2451ad7217f352c57ed51ffa84af (patch)
treeb50e8a6e9e212d7f5ec9b013cb7d3d45ed6d1086
parent5ea978f63a7835de5ed1c8a6b4af269b27511ba8 (diff)
downloadscummvm-rg350-4c91ace5307e2451ad7217f352c57ed51ffa84af.tar.gz
scummvm-rg350-4c91ace5307e2451ad7217f352c57ed51ffa84af.tar.bz2
scummvm-rg350-4c91ace5307e2451ad7217f352c57ed51ffa84af.zip
SCI/newgui: support for embedded cel data < 320 pixels width. fixes jones/vga
svn-id: r45061
-rw-r--r--engines/sci/gui/gui_picture.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/engines/sci/gui/gui_picture.cpp b/engines/sci/gui/gui_picture.cpp
index bb927a91f2..84f815c417 100644
--- a/engines/sci/gui/gui_picture.cpp
+++ b/engines/sci/gui/gui_picture.cpp
@@ -117,10 +117,10 @@ void SciGuiPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rle
byte priority = _addToFlag ? _priority : 0;
byte clearColor = headerPtr[6];
byte curByte, runLength;
- int16 y, x, lastY;
+ int16 y, lastY, x, leftX, rightX;
uint16 pixelNr, pixelCount;
- if (displaceX || displaceY || width != 320)
+ if (displaceX || displaceY)
error("unsupported embedded cel-data in picture");
pixelCount = width * height;
@@ -199,31 +199,31 @@ void SciGuiPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rle
// Set initial vertical coordinate by using current port
y = callerY + _gfx->GetPort()->top;
lastY = MIN<int16>(height + y, _gfx->GetPort()->rect.bottom + _gfx->GetPort()->top);
- if (callerX != 0)
- error("drawCelData() called with callerX != 0");
+ leftX = callerX + _gfx->GetPort()->left;
+ rightX = MIN<int16>(width + leftX, _gfx->GetPort()->rect.right + _gfx->GetPort()->left);
ptr = celBitmap;
if (!_mirroredFlag) {
// Draw bitmap to screen
- x = 0;
+ x = leftX;
while (y < lastY) {
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);
+ _screen->putPixel(callerX + x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
x++;
- if (x >= _screen->_width) {
- x -= _screen->_width; y++;
+ if (x >= rightX) {
+ x = leftX; y++;
}
}
} else {
// Draw bitmap to screen (mirrored)
- x = _screen->_width - 1;
+ x = rightX - 1;
while (y < lastY) {
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 == 0) {
- x = _screen->_width; y++;
+ _screen->putPixel(callerX + x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+ if (x == leftX) {
+ x = rightX; y++;
}
x--;
}