diff options
author | Filippos Karapetis | 2013-01-13 15:39:00 +0200 |
---|---|---|
committer | Filippos Karapetis | 2013-01-13 15:39:00 +0200 |
commit | b7bfff1bfaac86d53958b34b9dfcdfb8a1f2e55e (patch) | |
tree | be00013b9df8b152ea2460ad9b1f19b02993b53e /engines | |
parent | 1302f62b9f60f836b7323ce1448a1c428af0ddcb (diff) | |
download | scummvm-rg350-b7bfff1bfaac86d53958b34b9dfcdfb8a1f2e55e.tar.gz scummvm-rg350-b7bfff1bfaac86d53958b34b9dfcdfb8a1f2e55e.tar.bz2 scummvm-rg350-b7bfff1bfaac86d53958b34b9dfcdfb8a1f2e55e.zip |
TOLTECS: Fix bug #3599370 - "TOLTECS: Text on intro video not shown as per original"
Diffstat (limited to 'engines')
-rw-r--r-- | engines/toltecs/movie.cpp | 9 | ||||
-rw-r--r-- | engines/toltecs/screen.cpp | 6 | ||||
-rw-r--r-- | engines/toltecs/screen.h | 3 | ||||
-rw-r--r-- | engines/toltecs/toltecs.cpp | 4 |
4 files changed, 13 insertions, 9 deletions
diff --git a/engines/toltecs/movie.cpp b/engines/toltecs/movie.cpp index 45711ad983..201a0d602d 100644 --- a/engines/toltecs/movie.cpp +++ b/engines/toltecs/movie.cpp @@ -156,10 +156,11 @@ void MoviePlayer::playMovie(uint resIndex) { // Already processed break; case kChunkShowSubtitle: - if (_vm->_cfgText) { - memcpy(_vm->_script->getSlotData(subtitleSlot), chunkBuffer, chunkSize); - _vm->_screen->updateTalkText(subtitleSlot, 0); - } + memcpy(_vm->_script->getSlotData(subtitleSlot), chunkBuffer, chunkSize); + // The last character of the subtitle determines if it should + // always be displayed or not. If it's 0xFF, it should always be + // displayed, otherwise, if it's 0xFE, it can be toggled. + _vm->_screen->updateTalkText(subtitleSlot, 0, (chunkBuffer[chunkSize - 1] == 0xFF)); break; case kChunkShakeScreen: // start/stop shakescreen effect if (chunkBuffer[0] == 0xFF) diff --git a/engines/toltecs/screen.cpp b/engines/toltecs/screen.cpp index 1f3ab6b7bd..2f16c29ab2 100644 --- a/engines/toltecs/screen.cpp +++ b/engines/toltecs/screen.cpp @@ -345,7 +345,7 @@ void Screen::updateVerbLine(int16 slotIndex, int16 slotOffset) { _guiRefresh = true; } -void Screen::updateTalkText(int16 slotIndex, int16 slotOffset) { +void Screen::updateTalkText(int16 slotIndex, int16 slotOffset, bool alwaysDisplayed) { int16 x, y, maxWidth, width, length; byte durationModifier = 1; byte *textData = _vm->_script->getSlotData(slotIndex) + slotOffset; @@ -354,6 +354,7 @@ void Screen::updateTalkText(int16 slotIndex, int16 slotOffset) { item->fontNum = 0; item->color = _talkTextFontColor; + item->alwaysDisplayed = alwaysDisplayed; x = CLIP<int16>(_talkTextX - _vm->_cameraX, 120, _talkTextMaxWidth); y = CLIP<int16>(_talkTextY - _vm->_cameraY, 4, _vm->_cameraHeight - 16); @@ -469,7 +470,7 @@ void Screen::addTalkTextItemsToRenderQueue() { if (item->duration < 0) item->duration = 0; - if (!_vm->_cfgText) + if (!_vm->_cfgText && !item->alwaysDisplayed) return; for (byte j = 0; j < item->lineCount; j++) { @@ -754,6 +755,7 @@ void Screen::loadState(Common::ReadStream *in) { _talkTextItems[i].fontNum = in->readUint16LE(); _talkTextItems[i].color = in->readByte(); _talkTextItems[i].lineCount = in->readByte(); + _talkTextItems[i].alwaysDisplayed = false; for (int j = 0; j < _talkTextItems[i].lineCount; j++) { _talkTextItems[i].lines[j].x = in->readUint16LE(); _talkTextItems[i].lines[j].y = in->readUint16LE(); diff --git a/engines/toltecs/screen.h b/engines/toltecs/screen.h index 788cde50c6..f4ecd2ca62 100644 --- a/engines/toltecs/screen.h +++ b/engines/toltecs/screen.h @@ -136,6 +136,7 @@ struct TalkTextItem { byte color; byte lineCount; TextRect lines[15]; + bool alwaysDisplayed; }; struct GuiTextWrapState { @@ -177,7 +178,7 @@ public: void updateVerbLine(int16 slotIndex, int16 slotOffset); // Talk text - void updateTalkText(int16 slotIndex, int16 slotOffset); + void updateTalkText(int16 slotIndex, int16 slotOffset, bool alwaysDisplayed); void addTalkTextRect(Font &font, int16 x, int16 &y, int16 length, int16 width, TalkTextItem *item); void addTalkTextItemsToRenderQueue(); int16 getTalkTextDuration(); diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp index f6a2dfed9d..3b7b82d196 100644 --- a/engines/toltecs/toltecs.cpp +++ b/engines/toltecs/toltecs.cpp @@ -515,12 +515,12 @@ void ToltecsEngine::talk(int16 slotIndex, int16 slotOffset) { _sound->playSpeech(resIndex); } if (_doText) { - _screen->updateTalkText(slotIndex, slotOffset); + _screen->updateTalkText(slotIndex, slotOffset, false); } else { _screen->keepTalkTextItemsAlive(); } } else { - _screen->updateTalkText(slotIndex, slotOffset); + _screen->updateTalkText(slotIndex, slotOffset, true); } } |