diff options
author | Max Horn | 2003-03-04 02:45:50 +0000 |
---|---|---|
committer | Max Horn | 2003-03-04 02:45:50 +0000 |
commit | db404cb1c4a35dc77a305e496c716bb2656d2719 (patch) | |
tree | edb3ae6496c38ec9776d6114576aa98556c51970 /scumm | |
parent | 89f6ebb77cfdb8a758bbd89a51dc0a5580e694e6 (diff) | |
download | scummvm-rg350-db404cb1c4a35dc77a305e496c716bb2656d2719.tar.gz scummvm-rg350-db404cb1c4a35dc77a305e496c716bb2656d2719.tar.bz2 scummvm-rg350-db404cb1c4a35dc77a305e496c716bb2656d2719.zip |
load NUT fonts even if they do not specify full 256 chars (e.g. the COMI demo only defines 233 chars
svn-id: r6685
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/nut_renderer.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/scumm/nut_renderer.cpp b/scumm/nut_renderer.cpp index 76f317e6e4..aaff170240 100644 --- a/scumm/nut_renderer.cpp +++ b/scumm/nut_renderer.cpp @@ -105,25 +105,20 @@ bool NutRenderer::loadFont(const char *filename, const char *dir) { int32 l; uint32 offset = READ_BE_UINT32(_dataSrc + 4) + 8; + memset(_offsets, 0, 256 * sizeof(int32)); for (l = 0; l < 256; l++) { if (READ_BE_UINT32(_dataSrc + offset) == 'FRME') { offset += 8; if (READ_BE_UINT32(_dataSrc + offset) == 'FOBJ') { _offsets[l] = offset + 8; offset += READ_BE_UINT32(_dataSrc + offset + 4) + 8; + } else { + debug(2, "NutRenderer::loadFont(%s, %s) there is no FOBJ chunk in FRME chunk %d (offset %x)", filename, dir, l, offset); + break; } - else { - debug(2, "NutRenderer::loadFont() there is no FRME chunk"); - free(_dataSrc); - _dataSrc = NULL; - return false; - } - } - else { - debug(2, "NutRenderer::loadFont() there is no FOBJ chunk in FRME chunk"); - free(_dataSrc); - _dataSrc = NULL; - return false; + } else { + debug(2, "NutRenderer::loadFont(%s, %s) there is no FRME chunk %d (offset %x)", filename, dir, l, offset); + break; } } |