aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2008-03-17 21:15:24 +0000
committerFlorian Kagerer2008-03-17 21:15:24 +0000
commitd71523ae15fa6f2ca46911fc464e107934eba1f3 (patch)
tree67665fd4fbc94f201b4becbc28cb9bf5c90b4de7 /engines/kyra
parent136040b8692e79a48819192d4b37c53baabb5d12 (diff)
downloadscummvm-rg350-d71523ae15fa6f2ca46911fc464e107934eba1f3.tar.gz
scummvm-rg350-d71523ae15fa6f2ca46911fc464e107934eba1f3.tar.bz2
scummvm-rg350-d71523ae15fa6f2ca46911fc464e107934eba1f3.zip
remove unnecessary code duplication
svn-id: r31163
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/kyra_v2.cpp2
-rw-r--r--engines/kyra/kyra_v2.h3
-rw-r--r--engines/kyra/script_v2.cpp2
-rw-r--r--engines/kyra/text_v2.cpp24
4 files changed, 4 insertions, 27 deletions
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];