diff options
author | Adrian Frühwirth | 2018-01-26 20:38:53 +0100 |
---|---|---|
committer | Adrian Frühwirth | 2018-02-07 19:48:11 +0100 |
commit | 47eda4bcf76252b2c9be2427c897884449073394 (patch) | |
tree | b42d3600ff3ae29eb15a989a4f2b67c64fe6d2e3 /engines/tucker | |
parent | 94966010dbe392a4e8c9390db325a6f30d8455ab (diff) | |
download | scummvm-rg350-47eda4bcf76252b2c9be2427c897884449073394.tar.gz scummvm-rg350-47eda4bcf76252b2c9be2427c897884449073394.tar.bz2 scummvm-rg350-47eda4bcf76252b2c9be2427c897884449073394.zip |
TUCKER: Fix clipping handling when drawing text
Fixes Trac#10422.
Diffstat (limited to 'engines/tucker')
-rw-r--r-- | engines/tucker/graphics.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/tucker/graphics.cpp b/engines/tucker/graphics.cpp index b9c184e2bb..64ec81cb2a 100644 --- a/engines/tucker/graphics.cpp +++ b/engines/tucker/graphics.cpp @@ -170,10 +170,10 @@ void Graphics::drawStringChar(uint8 *dst, int xDst, int yDst, int pitch, uint8 c const int w = MIN(_charset._charW, pitch - xDst); dst += yDst * pitch + xDst; int offset = (chr - 32) * _charset._charH * _charset._charW; - for (int y = 0; y < h; ++y) { - for (int x = 0; x < w; ++x) { - const int color = src[offset++]; - if (color != 0) { + for (int y = 0; y < _charset._charH; ++y) { + for (int x = 0; x < _charset._charW; ++x, ++offset) { + const int color = src[offset]; + if (y < h && x < w && color != 0) { if (_charsetType == kCharsetTypeCredits) { dst[x] = color; } else { |