diff options
Diffstat (limited to 'engines/kyra/graphics')
-rw-r--r-- | engines/kyra/graphics/screen_eob.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/kyra/graphics/screen_eob.cpp b/engines/kyra/graphics/screen_eob.cpp index 90e2d1f41f..4cd471ee0a 100644 --- a/engines/kyra/graphics/screen_eob.cpp +++ b/engines/kyra/graphics/screen_eob.cpp @@ -1755,7 +1755,7 @@ bool OldDOSFont::load(Common::SeekableReadStream &file) { _width = _data[0x103]; _height = _data[0x102]; - _numGlyphs = 255; + _numGlyphs = (READ_LE_UINT16(_data + 2) / 2) - 2; _bitmapOffsets = (uint16 *)(_data + 2); @@ -1766,8 +1766,10 @@ bool OldDOSFont::load(Common::SeekableReadStream &file) { } int OldDOSFont::getCharWidth(uint16 c) const { - if (c >= _numGlyphs) - return 0; + // Since these fonts have a fixed character width we always give a return value + // even if there is no glyph for the specified character (which can't normally + // happen anyway - you'd have to do something like importing a Japanese save file + // into the English version). return _width; } @@ -1822,6 +1824,9 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch, int bpp) const { } } + if (c >= _numGlyphs) + return; + pitch *= bpp; const uint8 *src = &_data[_bitmapOffsets[c]]; uint8 *dst2 = dst + pitch; |