diff options
author | Torbjörn Andersson | 2003-06-15 15:19:22 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-06-15 15:19:22 +0000 |
commit | e175f75e7da0ee3195cc1d6b4567ff1d09be26ef (patch) | |
tree | 39488e875ca808fbc268c8c22017fff4dc69540d | |
parent | 81eeff479d57671c4400b47a508a99b88736f111 (diff) | |
download | scummvm-rg350-e175f75e7da0ee3195cc1d6b4567ff1d09be26ef.tar.gz scummvm-rg350-e175f75e7da0ee3195cc1d6b4567ff1d09be26ef.tar.bz2 scummvm-rg350-e175f75e7da0ee3195cc1d6b4567ff1d09be26ef.zip |
Made CharsetRendererNut::printChar() take the shadow into consideration
when calculating the dimensions of a printed message and when deciding
which parts of the screen to dirty.
I imagine this will fix most of the minor text-drawing glitches that have
been plaguing CoMI. Unfortunately, it fixes none of the major ones.
svn-id: r8511
-rw-r--r-- | scumm/charset.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index e40d5b6abb..100e851b03 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -850,15 +850,24 @@ int CharsetRendererNut::getFontHeight() { } void CharsetRendererNut::printChar(int chr) { + int shadow_left, shadow_right, shadow_top, shadow_bottom; + assert(_current); if (chr == '@') return; + shadow_left = _left - 1; + shadow_top = _top - 1; + + // Note that the character is drawn with a shadow, so it is slightly + // larger than the advertised dimensions. See drawShadowChar() for + // details. + if (_firstChar) { - _str.left = _left; - _str.top = _top; - _str.right = _left; - _str.bottom = _top; + _str.left = shadow_left; + _str.top = shadow_top; + _str.right = shadow_left; + _str.bottom = shadow_top; _firstChar = false; } @@ -868,16 +877,20 @@ void CharsetRendererNut::printChar(int chr) { if (chr >= 256 && _vm->_CJKMode) width = 16; + shadow_right = _left + width + 2; + shadow_bottom = _top + height + 2; + _hasMask = true; _current->drawShadowChar(chr, _left, _top, _color, !_ignoreCharsetMask); - _vm->updateDirtyRect(0, _left, _left + width, _top, _top + height, 0); + _vm->updateDirtyRect(0, shadow_left, shadow_right, shadow_top, shadow_bottom, 0); _left += width; - if (_left > _str.right) - _str.right = _left; - if (_top + height > _str.bottom) - _str.bottom = _top + height; + if (shadow_right > _str.right) + _str.right = shadow_right; + + if (shadow_bottom > _str.bottom) + _str.bottom = shadow_bottom; } #ifdef __PALM_OS__ |