aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/charset.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index 5190475c37..35670d9972 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1220,11 +1220,14 @@ void CharsetRendererV3::printChar(int chr, bool ignoreCharsetMask) {
height = _vm->_2byteHeight;
} else {
charPtr = _fontPtr + chr * 8;
-// width = height = 8;
width = getCharWidth(chr);
height = 8;
}
+ // Clip at the right side (to avoid drawing "outside" the screen bounds).
+ if (_left + origWidth > _right + 1)
+ return;
+
origWidth = width;
origHeight = height;