diff options
author | Paul Gilbert | 2011-12-07 20:49:11 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-12-07 20:49:11 +1100 |
commit | 6161d7906efc1a99c05aeef91e60bcc44aeb8ac4 (patch) | |
tree | 3d3f2f2b833c8af483090a16fbeadadd7c19a398 /engines | |
parent | dc34fc1dfb04c8ef3d0fb31ba7176b3234fd8680 (diff) | |
download | scummvm-rg350-6161d7906efc1a99c05aeef91e60bcc44aeb8ac4.tar.gz scummvm-rg350-6161d7906efc1a99c05aeef91e60bcc44aeb8ac4.tar.bz2 scummvm-rg350-6161d7906efc1a99c05aeef91e60bcc44aeb8ac4.zip |
TSAGE: Fix for displaying text correctly in Ringworld Spanish version.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/graphics.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index f0a5973e6b..171167c2ea 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -1254,7 +1254,11 @@ void GfxFont::setFontNumber(uint32 fontNumber) { if (!_fontData) _fontData = g_resourceManager->getResource(RES_FONT, _fontNumber, 0); - _numChars = READ_LE_UINT16(_fontData + 4); + // Since some TsAGE game versions don't have a valid character count at offset 4, use the offset of the + // first charactre data to calculate the number of characters in the offset table preceeding it + _numChars = (READ_LE_UINT32(_fontData + 12) - 12) / 4; + assert(_numChars <= 256); + _fontSize.y = READ_LE_UINT16(_fontData + 6); _fontSize.x = READ_LE_UINT16(_fontData + 8); _bpp = READ_LE_UINT16(_fontData + 10); |