diff options
author | Sven Hesse | 2011-01-27 21:12:27 +0000 |
---|---|---|
committer | Sven Hesse | 2011-01-27 21:12:27 +0000 |
commit | 03adf7fdf64cf9f739b2d78a613acec16165ed86 (patch) | |
tree | 9f30e3123e468cc9104b9b528543e505c4bdbdd2 /engines | |
parent | 261a640a9386f2504149b48b7518e3b501df6f47 (diff) | |
download | scummvm-rg350-03adf7fdf64cf9f739b2d78a613acec16165ed86.tar.gz scummvm-rg350-03adf7fdf64cf9f739b2d78a613acec16165ed86.tar.bz2 scummvm-rg350-03adf7fdf64cf9f739b2d78a613acec16165ed86.zip |
GOB: Only draw text when coordinates are within the surface
svn-id: r55575
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/inter_v2.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index eb7b8ef62c..7e47e9f4f9 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -1099,6 +1099,10 @@ bool Inter_v2::o2_printText(OpFuncParams ¶ms) { _vm->_draw->_textToPrint = buf; _vm->_draw->_transparency = 0; + SurfacePtr surface = _vm->_draw->_spritesArray[_vm->_draw->_destSurface]; + uint16 destWidth = surface ? surface->getWidth() : 0; + uint16 destHeight = surface ? surface->getHeight() : 0; + if (_vm->_draw->_backColor == 16) { _vm->_draw->_backColor = 0; _vm->_draw->_transparency = 1; @@ -1142,7 +1146,10 @@ bool Inter_v2::o2_printText(OpFuncParams ¶ms) { } else buf[i] = 0; - _vm->_draw->spriteOperation(DRAW_PRINTTEXT); + if ((_vm->_draw->_destSpriteX < destWidth) && + (_vm->_draw->_destSpriteY < destHeight)) + _vm->_draw->spriteOperation(DRAW_PRINTTEXT); + } while (_vm->_game->_script->peekByte() != 200); _vm->_game->_script->skip(1); |