aboutsummaryrefslogtreecommitdiff
path: root/scumm/charset.cpp
diff options
context:
space:
mode:
authorMax Horn2005-05-26 16:38:02 +0000
committerMax Horn2005-05-26 16:38:02 +0000
commit97f03369ec4086bf33da3a436c5c8e8aa3253a90 (patch)
tree09f02e4390da629d965a4b24934ed77b92d45b23 /scumm/charset.cpp
parent228121ae2d129665f84d6d78c39a39f80228373d (diff)
downloadscummvm-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/charset.cpp')
-rw-r--r--scumm/charset.cpp17
1 files changed, 13 insertions, 4 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;