aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2007-05-18 09:19:35 +0000
committerGregory Montoir2007-05-18 09:19:35 +0000
commit93e41222b5d2e938c66dc7cf249da6c3ec7f409c (patch)
tree91f57b0a0d6142ff12412aabc24f48ad5074f928
parente16e11fdf24678d79c4991623488c3d5c061722d (diff)
downloadscummvm-rg350-93e41222b5d2e938c66dc7cf249da6c3ec7f409c.tar.gz
scummvm-rg350-93e41222b5d2e938c66dc7cf249da6c3ec7f409c.tar.bz2
scummvm-rg350-93e41222b5d2e938c66dc7cf249da6c3ec7f409c.zip
added debug code to display sprite masks
svn-id: r26865
-rw-r--r--engines/cine/gfx.cpp4
-rw-r--r--engines/cine/gfx.h2
-rw-r--r--engines/cine/various.cpp3
3 files changed, 6 insertions, 3 deletions
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 57e58a7c1c..0435060595 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -166,7 +166,7 @@ void transformPaletteRange(byte startColor, byte stopColor, int8 r, int8 g, int8
//gfxFlipPage(page2);
}
-void gfxFillSprite(byte *spritePtr, uint16 width, uint16 height, byte *page, int16 x, int16 y) {
+void gfxFillSprite(byte *spritePtr, uint16 width, uint16 height, byte *page, int16 x, int16 y, uint8 fillColor) {
int16 i;
int16 j;
@@ -178,7 +178,7 @@ void gfxFillSprite(byte *spritePtr, uint16 width, uint16 height, byte *page, int
if (x + j >= 0 && x + j < 320 && i + y >= 0
&& i + y < 200) {
if (!*(spritePtr++)) {
- *(destPtr++) = 0;
+ *(destPtr++) = fillColor;
} else {
destPtr++;
}
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 0673c342bc..30841b6cb1 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -47,7 +47,7 @@ void transformPaletteRange(byte startColor, byte numColor, int8 r, int8 g, int8
void gfxFlipPage(void);
void gfxSpriteFunc1(byte *ptr, byte *msk, uint16 width, uint16 height, byte *page, int16 x, int16 y);
-void gfxFillSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy);
+void gfxFillSprite(byte *src4, uint16 sw, uint16 sh, byte *dst4, int16 sx, int16 sy, uint8 fillColor = 0);
void gfxSpriteFunc2(byte *spritePtr, byte *spriteMskPtr, int16 width, int16 height, byte *maskPtr,
int16 maskWidth, int16 maskHeight, byte *bufferSprPtr, byte *bufferMskPtr, int16 xs, int16 ys, int16 xm, int16 ym, byte maskIdx);
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 17dcc23f26..51f8f5d94c 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -2206,6 +2206,9 @@ void drawSprite(overlayHeadElement *currentOverlay, byte *spritePtr,
maskWidth = animDataTable[maskSpriteIdx].width / 2;
maskHeight = animDataTable[maskSpriteIdx].height;
gfxSpriteFunc2(spritePtr, maskPtr, width, height, animDataTable[maskSpriteIdx].ptr1, maskWidth, maskHeight, ptr, msk, x, y, maskX, maskY, i++);
+#if DEBUG_SPRITE_MASK
+ gfxFillSprite(animDataTable[maskSpriteIdx].ptr1, maskWidth, maskHeight, page, maskX, maskY, 1);
+#endif
}
pCurrentOverlay = pCurrentOverlay->next;