diff options
author | Sven Hesse | 2009-07-24 21:31:58 +0000 |
---|---|---|
committer | Sven Hesse | 2009-07-24 21:31:58 +0000 |
commit | 02ca620d7ce0c624a82d42a51c2a56682bc44ec3 (patch) | |
tree | 15b63b9fb80be3674c558d08ae55305fcc7405a2 /engines | |
parent | adc537161a048939c995475707f70cbe9c34b720 (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/gob/draw.cpp | 2 | ||||
-rw-r--r-- | engines/gob/draw.h | 3 | ||||
-rw-r--r-- | engines/gob/draw_v2.cpp | 21 |
3 files changed, 23 insertions, 3 deletions
diff --git a/engines/gob/draw.cpp b/engines/gob/draw.cpp index fb3cb9bbcd..46f75f67aa 100644 --- a/engines/gob/draw.cpp +++ b/engines/gob/draw.cpp @@ -303,6 +303,8 @@ void Draw::dirtiedRect(SurfaceDescPtr surface, invalidateRect(left, top, right, bottom); else if (surface == _frontSurface) _vm->_video->dirtyRectsAdd(left, top, right, bottom); + else if (_vm->_video->_splitSurf && (surface == _vm->_video->_splitSurf)) + _vm->_video->retrace(); } void Draw::initSpriteSurf(int16 index, int16 width, int16 height, diff --git a/engines/gob/draw.h b/engines/gob/draw.h index b41cb1abad..1da6ba4b74 100644 --- a/engines/gob/draw.h +++ b/engines/gob/draw.h @@ -77,6 +77,9 @@ public: int16 _backDeltaX; int16 _backDeltaY; + int16 _subtitleFont; + int16 _subtitleColor; + FontToSprite _fontToSprite[4]; Font *_fonts[kFontCount]; 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: |