aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-26 22:58:06 +0000
committerMartin Kiewitz2010-07-26 22:58:06 +0000
commita27f30fa15db7def6c5e6d44703427254baec4ae (patch)
tree19ff366cec723fa6481aa56112c5009d14adccd1 /engines/sci
parentea5f8049a2a3af836c81fb4698317b999c152459 (diff)
downloadscummvm-rg350-a27f30fa15db7def6c5e6d44703427254baec4ae.tar.gz
scummvm-rg350-a27f30fa15db7def6c5e6d44703427254baec4ae.tar.bz2
scummvm-rg350-a27f30fa15db7def6c5e6d44703427254baec4ae.zip
SCI: fixing text fonts not working correctly
fixes sq5 and bug #3034766 svn-id: r51335
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/text16.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index 4aa2346aed..08be203230 100644
--- a/engines/sci/graphics/text16.cpp
+++ b/engines/sci/graphics/text16.cpp
@@ -289,6 +289,8 @@ int16 GfxText16::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
if (fontId != -1)
SetFont(fontId);
+ else
+ fontId = oldFontId;
if (g_sci->getLanguage() == Common::JA_JPN)
SwitchToFont900OnSjis(text);
@@ -296,7 +298,7 @@ int16 GfxText16::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
rect.top = rect.left = 0;
if (maxWidth < 0) { // force output as single line
- StringWidth(text, oldFontId, textWidth, textHeight);
+ StringWidth(text, fontId, textWidth, textHeight);
rect.bottom = textHeight;
rect.right = textWidth;
} else {
@@ -308,7 +310,7 @@ int16 GfxText16::Size(Common::Rect &rect, const char *text, GuiResourceId fontId
charCount = GetLongest(curPos, rect.right, oldFontId);
if (charCount == 0)
break;
- Width(curPos, 0, charCount, oldFontId, textWidth, textHeight);
+ Width(curPos, 0, charCount, fontId, textWidth, textHeight);
maxTextWidth = MAX(textWidth, maxTextWidth);
totalHeight += textHeight;
curPos += charCount;
@@ -390,6 +392,8 @@ void GfxText16::Box(const char *text, int16 bshow, const Common::Rect &rect, Tex
if (fontId != -1)
SetFont(fontId);
+ else
+ fontId = orgFontId;
if (g_sci->getLanguage() == Common::JA_JPN) {
if (SwitchToFont900OnSjis(text))
@@ -420,9 +424,9 @@ void GfxText16::Box(const char *text, int16 bshow, const Common::Rect &rect, Tex
_ports->moveTo(rect.left + offset, rect.top + hline);
if (bshow) {
- Show(text, 0, charCount, orgFontId, orgPenColor);
+ Show(text, 0, charCount, fontId, orgPenColor);
} else {
- Draw(text, 0, charCount, orgFontId, orgPenColor);
+ Draw(text, 0, charCount, fontId, orgPenColor);
}
hline += textHeight;