diff options
author | Paul Gilbert | 2013-06-19 00:16:51 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-06-19 00:16:51 -0400 |
commit | 3e62f279d55b5ceb11c72887800fc5ed07e4e31b (patch) | |
tree | 92f326964f350a424c92d9dbe338c1ad8cd33de2 | |
parent | c0e6fcba732e58c8aef16362971ae2a91d749e3c (diff) | |
download | scummvm-rg350-3e62f279d55b5ceb11c72887800fc5ed07e4e31b.tar.gz scummvm-rg350-3e62f279d55b5ceb11c72887800fc5ed07e4e31b.tar.bz2 scummvm-rg350-3e62f279d55b5ceb11c72887800fc5ed07e4e31b.zip |
VOYEUR: Fix loading and use of font resource top padding
-rw-r--r-- | engines/voyeur/files.cpp | 18 | ||||
-rw-r--r-- | engines/voyeur/files.h | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 9e97dea1cd..09fbc17c56 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -844,7 +844,7 @@ int ViewPortResource::drawText(const Common::String &msg) { int yShadows[9] = { 0, 1, 0, -1, -1, -1, 0, 1, 1 }; Common::Rect *clipPtr = gfxManager._clipPtr; - if (!(fontInfo._picFlags & 1)) + if (!(fontInfo._picFlags & DISPFLAG_1)) gfxManager._clipPtr = NULL; int minChar = fontData._minChar; @@ -854,14 +854,14 @@ int ViewPortResource::drawText(const Common::String &msg) { int msgWidth = 0; int xp = 0, yp = 0; - Common::Point pos = fontInfo._pos; + Common::Point pos = Common::Point(fontInfo._pos.x, fontInfo._pos.y + fontData._topPadding); - _fontChar._flags = fontInfo._picFlags | 2; + _fontChar._flags = fontInfo._picFlags | DISPFLAG_2; _fontChar._select = fontInfo._picSelect; _fontChar._bounds.setHeight(fontHeight); - if (gfxManager._drawTextPermFlag || (fontInfo._fontFlags & 1) || fontInfo._justify || - (gfxManager._saveBack && fontInfo._fontSaveBack && (_flags & 0x8000))) { + if (gfxManager._drawTextPermFlag || (fontInfo._fontFlags & DISPFLAG_1) || fontInfo._justify || + (gfxManager._saveBack && fontInfo._fontSaveBack && (_flags & DISPFLAG_VIEWPORT))) { msgWidth = textWidth(msg); yp = pos.y; xp = pos.x; @@ -929,7 +929,7 @@ int ViewPortResource::drawText(const Common::String &msg) { addSaveRect(_pageIndex, _fontRect); } - if (fontInfo._fontFlags & 1) { + if (fontInfo._fontFlags & DISPFLAG_1) { gfxManager._drawPtr->_pos = Common::Point(_fontRect.left, _fontRect.top); gfxManager._drawPtr->_penColor = fontInfo._backColor; sFillBox(_fontRect.width()); @@ -939,9 +939,9 @@ int ViewPortResource::drawText(const Common::String &msg) { gfxManager._saveBack = false; int count = 0; - if (fontInfo._fontFlags & 4) + if (fontInfo._fontFlags & DISPFLAG_4) count = 1; - else if (fontInfo._fontFlags & 8) + else if (fontInfo._fontFlags & DISPFLAG_8) count = 8; for (int i = count; i >= 0; --i) { @@ -1097,7 +1097,7 @@ FontResource::FontResource(BoltFilesState &state, byte *src) { field2 = src[2]; _padding = src[3]; _fontHeight = src[5]; - field6 = src[6]; + _topPadding = (int8)src[6]; int totalChars = _maxChar - _minChar + 1; _charWidth = new int[totalChars]; diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 77b53ccdef..a00686397c 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -301,7 +301,7 @@ public: int field2; int _padding; int _fontHeight; - int field6; + int _topPadding; int *_charWidth; byte *_data1; byte *_data2; |