aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/video_v6.cpp
diff options
context:
space:
mode:
authorSven Hesse2008-12-12 00:10:39 +0000
committerSven Hesse2008-12-12 00:10:39 +0000
commit19146fe03206a2039c0dd568af1a81a8e5411556 (patch)
tree4c65e1b8eeb0b10a0abf7b9a879d3d20e42248bc /engines/gob/video_v6.cpp
parentc65886a3ea3a4fb30d34d9cc3136dd34db044d9f (diff)
downloadscummvm-rg350-19146fe03206a2039c0dd568af1a81a8e5411556.tar.gz
scummvm-rg350-19146fe03206a2039c0dd568af1a81a8e5411556.tar.bz2
scummvm-rg350-19146fe03206a2039c0dd568af1a81a8e5411556.zip
Working cursor in Urban Runner
svn-id: r35309
Diffstat (limited to 'engines/gob/video_v6.cpp')
-rw-r--r--engines/gob/video_v6.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp
index 3433e72bc5..27bc88ad1f 100644
--- a/engines/gob/video_v6.cpp
+++ b/engines/gob/video_v6.cpp
@@ -58,10 +58,12 @@ void Video_v6::drawPacked(const byte *sprBuf, int16 x, int16 y, SurfaceDesc *sur
int16 height = READ_LE_UINT16(data + 2);
data += 4;
+ warning("drawPacked: %d, %d, %d, %d", x, y, width, height);
+
const byte *srcData = data;
byte *uncBuf = 0;
- if (*data++ != 0) {
+ if (*srcData++ != 0) {
uint32 size = READ_LE_UINT32(data);
uncBuf = new byte[size];
@@ -88,6 +90,8 @@ void Video_v6::drawYUVData(const byte *srcData, SurfaceDesc *destDesc,
if (dataHeight & 0xF)
dataHeight = (dataHeight & 0xFFF0) + 16;
+ warning("drawYUVData: %d, %d, %d, %d, %d, %d", x, y, width, height, dataWidth, dataHeight);
+
const byte *dataY = srcData;
const byte *dataU = dataY + (dataWidth * dataHeight);
const byte *dataV = dataU + ((dataWidth * dataHeight) >> 4);
@@ -114,10 +118,15 @@ void Video_v6::drawYUV(SurfaceDesc *destDesc, int16 x, int16 y,
int16 dataWidth, int16 dataHeight, int16 width, int16 height,
const byte *dataY, const byte *dataU, const byte *dataV) {
- byte *vidMem = destDesc->getVidMem() + y * width + x;
+ warning("drawYUV: %dx%d->%d+%d (%dx%d) (%dx%d)", width, height, x, y, dataWidth, dataHeight,
+ destDesc->getWidth(), destDesc->getHeight());
+
+ byte *vidMem = destDesc->getVidMem() + y * destDesc->getWidth() + x;
- width = MIN(width, destDesc->getWidth());
- height = MIN(height, destDesc->getHeight());
+ if ((x + width - 1) >= destDesc->getWidth())
+ width = destDesc->getWidth() - x;
+ if ((y + height - 1) >= destDesc->getHeight())
+ height = destDesc->getHeight() - y;
SierraLight *dither = new SierraLight(width, height, _palLUT);
@@ -136,7 +145,7 @@ void Video_v6::drawYUV(SurfaceDesc *destDesc, int16 x, int16 y,
}
dither->nextLine();
- vidMem += width;
+ vidMem += destDesc->getWidth();
}
}