remove unnecessary code duplication

svn-id: r31163
This commit is contained in:
Florian Kagerer 2008-03-17 21:15:24 +00:00
parent 136040b869
commit d71523ae15
4 changed files with 4 additions and 27 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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;
}

View File

@ -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];