diff options
author | Travis Howell | 2004-10-05 23:37:59 +0000 |
---|---|---|
committer | Travis Howell | 2004-10-05 23:37:59 +0000 |
commit | 23ae8207deda440157c31b8f2493f268c8d0d0bd (patch) | |
tree | 6c66b492bc869c7315a64d6c665f5351314dcd01 /scumm | |
parent | ac896f09dc801a0fc48936feba487dca1d381c1f (diff) | |
download | scummvm-rg350-23ae8207deda440157c31b8f2493f268c8d0d0bd.tar.gz scummvm-rg350-23ae8207deda440157c31b8f2493f268c8d0d0bd.tar.bz2 scummvm-rg350-23ae8207deda440157c31b8f2493f268c8d0d0bd.zip |
Better clipping code.
svn-id: r15424
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/charset.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 10d2781496..760b84a3a2 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1213,7 +1213,7 @@ void CharsetRendererClassic::printChar(int chr) { _vm->_charsetColorMap[1] = _color; - int charUnk = *_fontPtr; + int type = *_fontPtr; if (is2byte) { _dropShadow = true; charPtr = _vm->get2byteCharPtr(chr); @@ -1312,19 +1312,20 @@ void CharsetRendererClassic::printChar(int chr) { drawTop = _top - _vm->_screenTop; } - if ((_vm->_heversion >= 71 && charUnk >= 8) || (_vm->_heversion >= 90 && charUnk == 0)) { - Common::Rect clip, src, dst; - - clip.top = clip.left = 0; - clip.right = vs->w - 1; - clip.bottom = vs->h - 1; + if ((_vm->_heversion >= 71 && type >= 8) || (_vm->_heversion >= 90 && type == 0)) { + Common::Rect src, dst; dst.left = _left; dst.top = _top; dst.right = dst.left + width; dst.bottom = dst.top + height; - dst.clip(clip); + if (dst.left < 0) + dst.left = 0; + + if (dst.top < 0) + dst.top = 0; + if ((dst.left >= dst.right) || (dst.top >= dst.bottom)) return; |