From 660aa716625866ae3a9db2a001ed3af6e108caaf Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Mon, 1 Jun 2009 13:37:51 +0000 Subject: [PATCH] LOL: - extended text displayer and added one more opcode svn-id: r41100 --- engines/kyra/script_lol.cpp | 2 +- engines/kyra/sequences_lol.cpp | 10 +++++++--- engines/kyra/text_lol.cpp | 11 ++++++++++- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/engines/kyra/script_lol.cpp b/engines/kyra/script_lol.cpp index ba0b5f4643f..d8cc6a3c61a 100644 --- a/engines/kyra/script_lol.cpp +++ b/engines/kyra/script_lol.cpp @@ -2722,7 +2722,7 @@ void LoLEngine::setupOpcodeTable() { Opcode(olol_assignSpecialGuiShape); Opcode(olol_findInventoryItem); Opcode(olol_restoreFadePalette); - OpcodeUnImpl(); + Opcode(olol_calcNewBlockPosition); // 0xA8 OpcodeUnImpl(); diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp index 3cb203998ab..1f5a2c35ec0 100644 --- a/engines/kyra/sequences_lol.cpp +++ b/engines/kyra/sequences_lol.cpp @@ -578,15 +578,16 @@ int LoLEngine::selectionCharInfo(int character) { void LoLEngine::selectionCharInfoIntro(char *file) { int index = 0; file[4] = '0'; + bool processAnim = true; while (_charSelectionInfoResult == -1 && !shouldQuit()) { - if (!_sound->isVoicePresent(file)) + if (_speechFlag && !_sound->isVoicePresent(file)) break; _sound->voicePlay(file, &_speechHandle); int i = 0; - while (_sound->voiceIsPlaying(&_speechHandle) && _charSelectionInfoResult == -1 && !shouldQuit()) { + while ((!_speechFlag || (_speechFlag && _sound->voiceIsPlaying(&_speechHandle))) && _charSelectionInfoResult == -1 && !shouldQuit()) { _screen->drawShape(0, _screen->getPtrToShape(_screen->getCPagePtr(9), _charInfoFrameTable[i]), 11, 130, 0, 0); _screen->updateScreen(); @@ -596,7 +597,10 @@ void LoLEngine::selectionCharInfoIntro(char *file) { _system->delayMillis(10); } - i = (i + 1) % 32; + if (_speechFlag || processAnim) + i = (i + 1) % 32; + if (i == 0) + processAnim = false; } _sound->voiceStop(&_speechHandle); diff --git a/engines/kyra/text_lol.cpp b/engines/kyra/text_lol.cpp index 3ddcfdaebc4..7ce12f47c7b 100644 --- a/engines/kyra/text_lol.cpp +++ b/engines/kyra/text_lol.cpp @@ -354,6 +354,8 @@ void TextDisplayer_LoL::displayText(char *str, ...) { const ScreenDim *sd = _screen->_curDim; int sdx = _screen->curDimIndex(); + uint16 charsPerLine = (sd->w << 3) / (_screen->getFontWidth() + _screen->_charWidth); + while (c) { char a = tolower(_ctrl[1]); @@ -372,6 +374,8 @@ void TextDisplayer_LoL::displayText(char *str, ...) { c = parseCommand(); } + uint16 dv = _textDimData[sdx].column / (_screen->getFontWidth() + _screen->_charWidth); + switch (c - 1) { case 0: printLine(_currentLine); @@ -390,7 +394,12 @@ void TextDisplayer_LoL::displayText(char *str, ...) { break; case 8: - //TODO + printLine(_currentLine); + dv = _textDimData[sdx].column / (_screen->getFontWidth() + _screen->_charWidth); + dv = ((dv + 8) & 0xfff8) - 1; + if (dv >= charsPerLine) + dv = 0; + _textDimData[sdx].column = (_screen->getFontWidth() + _screen->_charWidth) * dv; break; case 11: