From d71523ae15fa6f2ca46911fc464e107934eba1f3 Mon Sep 17 00:00:00 2001 From: Florian Kagerer Date: Mon, 17 Mar 2008 21:15:24 +0000 Subject: remove unnecessary code duplication svn-id: r31163 --- engines/kyra/kyra_v2.cpp | 2 +- engines/kyra/kyra_v2.h | 3 +-- engines/kyra/script_v2.cpp | 2 +- engines/kyra/text_v2.cpp | 24 +----------------------- 4 files changed, 4 insertions(+), 27 deletions(-) (limited to 'engines/kyra') diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index 6f26026211..0ecb5e6b66 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -1620,7 +1620,7 @@ void KyraEngine_v2::showIdleAnim() { static bool scriptAnimation = false; if (!scriptAnimation && _flags.isTalkie) { scriptAnimation = true; - zanthIdleChat(); + zanthRandomIdleChat(); } else { scriptAnimation = false; if (_loadedZTable > 8) diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index dc4dddac86..000f206b5d 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -798,8 +798,7 @@ protected: void startDialogue(int dlgIndex); void zanthSceneStartupChat(); - void zanthRandomChat(); - void zanthIdleChat(); + void zanthRandomIdleChat(); void updateDlgBuffer(); void loadDlgHeader(int &csEntry, int &vocH, int &scIndex1, int &scIndex2); void processDialogue(int dlgOffset, int vocH = 0, int csEntry = 0); diff --git a/engines/kyra/script_v2.cpp b/engines/kyra/script_v2.cpp index 1ce600a94f..d89df97176 100644 --- a/engines/kyra/script_v2.cpp +++ b/engines/kyra/script_v2.cpp @@ -904,7 +904,7 @@ int KyraEngine_v2::o2_startDialogue(ScriptState *script) { int KyraEngine_v2::o2_zanthRandomChat(ScriptState *script) { debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_zanthRandomChat(%p)", (const void *)script); - zanthRandomChat(); + zanthRandomIdleChat(); return 0; } diff --git a/engines/kyra/text_v2.cpp b/engines/kyra/text_v2.cpp index 2aaa47d25f..77eaf68d02 100644 --- a/engines/kyra/text_v2.cpp +++ b/engines/kyra/text_v2.cpp @@ -410,7 +410,7 @@ void KyraEngine_v2::zanthSceneStartupChat() { _newSceneDlgState[tableIndex] = 1; } -void KyraEngine_v2::zanthRandomChat() { +void KyraEngine_v2::zanthRandomIdleChat() { int lowest = _flags.isTalkie ? 6 : 5; int tableIndex = (_mainCharacter.sceneId - READ_LE_UINT16(&_ingameTalkObjIndex[lowest + _newChapterFile])) << 2; if (queryGameFlag(0x164)) @@ -432,28 +432,6 @@ void KyraEngine_v2::zanthRandomChat() { 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); -} - void KyraEngine_v2::updateDlgBuffer() { static const char DlgFileTemplate[] = "CH**-S**.DLG"; char filename[13]; -- cgit v1.2.3