aboutsummaryrefslogtreecommitdiff
path: root/engines/chewy
diff options
context:
space:
mode:
authorFilippos Karapetis2017-03-14 22:49:39 +0200
committerFilippos Karapetis2017-03-14 22:51:12 +0200
commit7ccc55d53d6394de39a8b2d35ba396482cf8eb56 (patch)
treeb6afe2659f68beb0191f378f2af0d1a306c45d93 /engines/chewy
parent6ce4f58f891b25f266143176ab4d252bb2e650f8 (diff)
downloadscummvm-rg350-7ccc55d53d6394de39a8b2d35ba396482cf8eb56.tar.gz
scummvm-rg350-7ccc55d53d6394de39a8b2d35ba396482cf8eb56.tar.bz2
scummvm-rg350-7ccc55d53d6394de39a8b2d35ba396482cf8eb56.zip
CHEWY: Properly clip drawn text
Diffstat (limited to 'engines/chewy')
-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();