diff options
author | Max Horn | 2005-05-26 16:38:02 +0000 |
---|---|---|
committer | Max Horn | 2005-05-26 16:38:02 +0000 |
commit | 97f03369ec4086bf33da3a436c5c8e8aa3253a90 (patch) | |
tree | 09f02e4390da629d965a4b24934ed77b92d45b23 /scumm | |
parent | 228121ae2d129665f84d6d78c39a39f80228373d (diff) | |
download | scummvm-rg350-97f03369ec4086bf33da3a436c5c8e8aa3253a90.tar.gz scummvm-rg350-97f03369ec4086bf33da3a436c5c8e8aa3253a90.tar.bz2 scummvm-rg350-97f03369ec4086bf33da3a436c5c8e8aa3253a90.zip |
Take the font height from the charset header for V3 fonts, too; determine the number of chars for V4/V5 fonts, too
svn-id: r18266
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/charset.cpp | 17 | ||||
-rw-r--r-- | scumm/charset.h | 5 |
2 files changed, 16 insertions, 6 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index b1efd42172..fffad02a52 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -233,6 +233,10 @@ void CharsetRendererCommon::setCurID(byte id) { _fontPtr += 17; else _fontPtr += 29; + + //_bitDepth = _fontPtr[0]; + _fontHeight = _fontPtr[1]; + _numChars = READ_LE_UINT16(_fontPtr + 2); } void CharsetRendererV3::setCurID(byte id) { @@ -244,7 +248,10 @@ void CharsetRendererV3::setCurID(byte id) { if (_fontPtr == 0) error("CharsetRendererCommon::setCurID: charset %d not found!", id); + //_bitDepth = 1; _numChars = _fontPtr[4]; + _fontHeight = _fontPtr[5]; + _fontPtr += 6; _widthTable = _fontPtr; _fontPtr += _numChars; @@ -252,16 +259,16 @@ void CharsetRendererV3::setCurID(byte id) { int CharsetRendererCommon::getFontHeight() { if (_vm->_useCJKMode) - return MAX(_vm->_2byteHeight + 1, (int)_fontPtr[1]); + return MAX(_vm->_2byteHeight + 1, _fontHeight); else - return _fontPtr[1]; + return _fontHeight; } int CharsetRendererV3::getFontHeight() { if (_vm->_useCJKMode) - return MAX(_vm->_2byteHeight + 1, 8); + return MAX(_vm->_2byteHeight + 1, _fontHeight); else - return 8; + return _fontHeight; } // do spacing for variable width old-style font @@ -1098,6 +1105,8 @@ static byte spanishCharsetDataV2[] = { CharsetRendererV2::CharsetRendererV2(ScummEngine *vm, Common::Language language) : CharsetRendererV3(vm) { + _fontHeight = 8; + switch (language) { case Common::DE_DEU: _fontPtr = germanCharsetDataV2; diff --git a/scumm/charset.h b/scumm/charset.h index c231f0c29c..58228feb1b 100644 --- a/scumm/charset.h +++ b/scumm/charset.h @@ -114,11 +114,13 @@ public: class CharsetRendererCommon : public CharsetRenderer { protected: byte *_fontPtr; + int _numChars; + int _fontHeight; void drawBits1(const Graphics::Surface &s, byte *dst, const byte *src, int drawTop, int width, int height); public: - CharsetRendererCommon(ScummEngine *vm) : CharsetRenderer(vm) {} + CharsetRendererCommon(ScummEngine *vm) : CharsetRenderer(vm), _numChars(0), _fontHeight(0) {} void setCurID(byte id); @@ -157,7 +159,6 @@ public: class CharsetRendererV3 : public CharsetRendererCommon { protected: - int _numChars; byte *_widthTable; public: |