diff options
author | Florian Kagerer | 2008-03-16 17:16:17 +0000 |
---|---|---|
committer | Florian Kagerer | 2008-03-16 17:16:17 +0000 |
commit | 04a2ac14854c302c88b9f17cb5c9dbacf1fa6a89 (patch) | |
tree | a5746d8a04369eecee96688ffa32a66efca15282 /engines | |
parent | 79cc924d0e82fc6da46d0d776ed5949c105af453 (diff) | |
download | scummvm-rg350-04a2ac14854c302c88b9f17cb5c9dbacf1fa6a89.tar.gz scummvm-rg350-04a2ac14854c302c88b9f17cb5c9dbacf1fa6a89.tar.bz2 scummvm-rg350-04a2ac14854c302c88b9f17cb5c9dbacf1fa6a89.zip |
- implement zanthIdleChat()
- bug fix for zanthRandomChat()
svn-id: r31147
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 12 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 3 | ||||
-rw-r--r-- | engines/kyra/scene_v2.cpp | 2 | ||||
-rw-r--r-- | engines/kyra/text_v2.cpp | 38 |
4 files changed, 40 insertions, 15 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 84c2cd1029..69473257bb 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1593,14 +1593,14 @@ void KyraEngine_v2::showIdleAnim() { 0x04, 0x06, 0x07, 0x08, 0x04, 0x09, 0x0A, 0x0B, 0xFF, 0x00 }; - if (queryGameFlag(0x159)) + if (queryGameFlag(0x159 && _flags.isTalkie)) return; static bool scriptAnimation = false; - //if (!scriptAnimation) { - // scriptAnimation = true; - // sub_2715D(); - //} else { + if (!scriptAnimation && _flags.isTalkie) { + scriptAnimation = true; + zanthIdleChat(); + } else { scriptAnimation = false; if (_loadedZTable > 8) return; @@ -1619,7 +1619,7 @@ void KyraEngine_v2::showIdleAnim() { runIdleScript(script); _lastIdleScript = script; - //} + } } void KyraEngine_v2::runIdleScript(int script) { diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index f4084be06d..f5d5ce1c56 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -799,6 +799,7 @@ protected: void zanthSceneStartupChat(); void zanthRandomChat(); + void zanthIdleChat(); void updateDlgBuffer(); void loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2); void processDialogue(int dlgOffset, int vocH = 0, int csEntry = 0); @@ -1095,7 +1096,7 @@ protected: uint8 *_unkBuf500Bytes; uint8 *_unkBuf200kByte; - bool _unkFlag1; + bool _chatAltFlag; int _unk3, _unk4, _unk5; bool _unkSceneScreenFlag1; bool _unkHandleSceneChangeFlag; diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp index eda2122077..83d0f28aef 100644 --- a/engines/kyra/scene_v2.cpp +++ b/engines/kyra/scene_v2.cpp @@ -86,7 +86,7 @@ void KyraEngine_v2::enterNewScene(uint16 newScene, int facing, int unk1, int unk _sound->beginFadeOut(); } - _unkFlag1 = false; + _chatAltFlag = false; if (!unk3) { _scriptInterpreter->initScript(&_sceneScriptState, &_sceneScriptData); diff --git a/engines/kyra/text_v2.cpp b/engines/kyra/text_v2.cpp index adcaacbd15..2aaa47d25f 100644 --- a/engines/kyra/text_v2.cpp +++ b/engines/kyra/text_v2.cpp @@ -394,7 +394,8 @@ void KyraEngine_v2::startDialogue(int dlgIndex) { } void KyraEngine_v2::zanthSceneStartupChat() { - int tableIndex = _mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[5 + _newChapterFile]); + int lowest = _flags.isTalkie ? 6 : 5; + int tableIndex = _mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile]); if (queryGameFlag(0x159) || _newSceneDlgState[tableIndex]) return; @@ -410,7 +411,8 @@ void KyraEngine_v2::zanthSceneStartupChat() { } void KyraEngine_v2::zanthRandomChat() { - int tableIndex = _mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[5 + _newChapterFile]); + int lowest = _flags.isTalkie ? 6 : 5; + int tableIndex = (_mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile])) << 2; if (queryGameFlag(0x164)) return; @@ -418,14 +420,36 @@ void KyraEngine_v2::zanthRandomChat() { updateDlgBuffer(); loadDlgHeader(csEntry, vocH, scIndex1, unused); - if (_unkFlag1) { - _unkFlag1 = 0; + if (_chatAltFlag) { + _chatAltFlag = 0; tableIndex += 2; } else { - _unkFlag1 = 1; + _chatAltFlag = 1; } - uint8 bufferIndex = 8 + scIndex1 * 6 + tableIndex * 2; + uint8 bufferIndex = 8 + scIndex1 * 6 + tableIndex; + int offs = READ_LE_UINT16(_dlgBuffer + bufferIndex); + processDialogue(offs, vocH, csEntry); +} + +void KyraEngine_v2::zanthIdleChat() { + int lowest = _flags.isTalkie ? 6 : 5; + int tableIndex = (_mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile])) << 2; + if (queryGameFlag(0x164)) + return; + + int csEntry, vocH, scIndex1, unused; + updateDlgBuffer(); + loadDlgHeader(csEntry, vocH, scIndex1, unused); + + if (_chatAltFlag) { + _chatAltFlag = 0; + tableIndex += 2; + } else { + _chatAltFlag = 1; + } + + uint8 bufferIndex = 8 + scIndex1 * 6 + tableIndex; int offs = READ_LE_UINT16(_dlgBuffer + bufferIndex); processDialogue(offs, vocH, csEntry); } @@ -700,7 +724,7 @@ void KyraEngine_v2::setNewDlgIndex(int dlgIndex) { memset(_newSceneDlgState, 0, 32); for (int i = 0; i < 19; i++) memset(_conversationState[i], -1, 14); - _unkFlag1 = false; + _chatAltFlag = false; _mainCharacter.dlgIndex = dlgIndex; } |