From 02ca620d7ce0c624a82d42a51c2a56682bc44ec3 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Fri, 24 Jul 2009 21:31:58 +0000 Subject: Caching the subtitle font and color, because some don't assign those svn-id: r42706 --- engines/gob/draw_v2.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'engines/gob/draw_v2.cpp') diff --git a/engines/gob/draw_v2.cpp b/engines/gob/draw_v2.cpp index 9b7a536759..5312b9c00a 100644 --- a/engines/gob/draw_v2.cpp +++ b/engines/gob/draw_v2.cpp @@ -216,7 +216,9 @@ void Draw_v2::printTotText(int16 id) { dataPtr = textItem->getData(); ptr = dataPtr; - if ((ptr[1] & 0x80) && !_vm->subtitles()) { + bool isSubtitle = (ptr[1] & 0x80) != 0; + + if (isSubtitle && !_vm->subtitles()) { delete textItem; return; } @@ -398,10 +400,15 @@ void Draw_v2::printTotText(int16 id) { } else { _destSpriteX = offX; _destSpriteY = offY; - _fontIndex = fontIndex; - _frontColor = frontColor; + _fontIndex = fontIndex; + _frontColor = frontColor; _textToPrint = str; + if (isSubtitle) { + _fontIndex = _subtitleFont; + _frontColor = _subtitleColor; + } + if (_needAdjust != 2) { if ((_destSpriteX >= destX) && (_destSpriteY >= destY) && (((_fonts[_fontIndex]->getCharHeight() / 2) + _destSpriteY - 1) <= spriteBottom)) { @@ -461,11 +468,19 @@ void Draw_v2::printTotText(int16 id) { fontIndex = ((*ptr & 0xF0) >> 4) & 7; frontColor = *ptr & 0x0F; ptr++; + + if (isSubtitle) { + _subtitleFont = fontIndex; + _subtitleColor = frontColor; + } break; case 4: ptr++; frontColor = *ptr++; + + if (isSubtitle) + _subtitleColor = frontColor; break; case 6: -- cgit v1.2.3