aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/draw_v2.cpp
diff options
context:
space:
mode:
authorSven Hesse2009-07-24 21:31:58 +0000
committerSven Hesse2009-07-24 21:31:58 +0000
commit02ca620d7ce0c624a82d42a51c2a56682bc44ec3 (patch)
tree15b63b9fb80be3674c558d08ae55305fcc7405a2 /engines/gob/draw_v2.cpp
parentadc537161a048939c995475707f70cbe9c34b720 (diff)
downloadscummvm-rg350-02ca620d7ce0c624a82d42a51c2a56682bc44ec3.tar.gz
scummvm-rg350-02ca620d7ce0c624a82d42a51c2a56682bc44ec3.tar.bz2
scummvm-rg350-02ca620d7ce0c624a82d42a51c2a56682bc44ec3.zip
Caching the subtitle font and color, because some don't assign those
svn-id: r42706
Diffstat (limited to 'engines/gob/draw_v2.cpp')
-rw-r--r--engines/gob/draw_v2.cpp21
1 files changed, 18 insertions, 3 deletions
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: