aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/chewy/graphics.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/chewy/graphics.cpp b/engines/chewy/graphics.cpp
index 9ff681a450..2f7c28ad6c 100644
--- a/engines/chewy/graphics.cpp
+++ b/engines/chewy/graphics.cpp
@@ -89,10 +89,12 @@ void Graphics::drawTransparent(uint16 x, uint16 y, byte *data, uint16 width, uin
::Graphics::Surface *screen = g_system->lockScreen();
for (uint curX = 0; curX < width; curX++) {
for (uint curY = 0; curY < height; curY++) {
- byte *src = data + (curY * width) + curX;
- byte *dst = (byte *)screen->getBasePtr(curX + x, curY + y);
- if (*src != transparentColor)
- *dst = *src;
+ if (curX + x < 320 && curY + y < 200) {
+ byte *src = data + (curY * width) + curX;
+ byte *dst = (byte *)screen->getBasePtr(curX + x, curY + y);
+ if (*src != transparentColor)
+ *dst = *src;
+ }
}
}
g_system->unlockScreen();