diff options
-rw-r--r-- | engines/hopkins/globals.cpp | 6 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 6 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 14 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 16 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 38 | ||||
-rw-r--r-- | engines/hopkins/script.cpp | 152 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 27 | ||||
-rw-r--r-- | engines/hopkins/talk.h | 6 |
8 files changed, 135 insertions, 130 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 340b40ed46..2e24ac5c7a 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -90,7 +90,7 @@ Globals::Globals() { for (int i = 0; i < 500; ++i) _spriteSize[i] = 0; for (int i = 0; i < 70; ++i) - Common::fill((byte *)&Hopkins[i], (byte *)&Hopkins[i] + sizeof(HopkinsItem), 0); + Common::fill((byte *)&_hopkinsItem[i], (byte *)&_hopkinsItem[i] + sizeof(HopkinsItem), 0); for (int i = 0; i < 36; ++i) _inventory[i] = 0; @@ -275,8 +275,8 @@ void Globals::loadCharacterData() { const int *srcP = srcList[_characterType]; for (int idx = 0; idx < 240 / 4; ++idx) { - Hopkins[idx].field0 = *srcP++; - Hopkins[idx].field2 = *srcP++; + _hopkinsItem[idx]._speedX = *srcP++; + _hopkinsItem[idx]._speedY = *srcP++; } _oldFrameIndex = -1; diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index 241beb5a8e..6ac029d963 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -107,8 +107,8 @@ struct CacheItem { }; struct HopkinsItem { - int field0; - int field2; + int _speedX; + int _speedY; }; struct CharacterLocation { @@ -274,7 +274,7 @@ public: byte *_answerBuffer; Sauvegarde *_saveData; Language _language; - HopkinsItem Hopkins[70]; + HopkinsItem _hopkinsItem[70]; SortItem _sortedDisplay[51]; CreditItem _creditsItem[200]; diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index ded9be606d..fd937e3ad1 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -1884,7 +1884,7 @@ void HopkinsEngine::bombExplosion() { } _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO2("vire.pe2"); + _talkManager.startStaticCharacterDialogue("vire.pe2"); _globals._introSpeechOffFl = false; _objectsManager.setBobAnimation(7); @@ -1953,7 +1953,7 @@ void HopkinsEngine::handleConflagration() { _eventsManager.VBL(); _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO("SVGARD1.pe2"); + _talkManager.startAnimatedCharacterDialogue("SVGARD1.pe2"); _globals._introSpeechOffFl = false; for (int cpt = 0; cpt <= 49; cpt++) @@ -2078,7 +2078,7 @@ void HopkinsEngine::playEnding() { while (_objectsManager.getBobAnimDataIdx(6) != 54); _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO("GM4.PE2"); + _talkManager.startAnimatedCharacterDialogue("GM4.PE2"); _globals._disableInventFl = true; _objectsManager.stopBobAnimation(6); _objectsManager.stopBobAnimation(10); @@ -2096,7 +2096,7 @@ void HopkinsEngine::playEnding() { while (_objectsManager.getBobAnimDataIdx(7) != 65); _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO("DUELB4.PE2"); + _talkManager.startAnimatedCharacterDialogue("DUELB4.PE2"); _eventsManager.mouseOff(); _globals._disableInventFl = true; @@ -2105,14 +2105,14 @@ void HopkinsEngine::playEnding() { while (_objectsManager.getBobAnimDataIdx(7) != 72); _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO("DUELH1.PE2"); + _talkManager.startAnimatedCharacterDialogue("DUELH1.PE2"); do _eventsManager.VBL(); while (_objectsManager.getBobAnimDataIdx(7) != 81); _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO("DUELB5.PE2"); + _talkManager.startAnimatedCharacterDialogue("DUELB5.PE2"); do _eventsManager.VBL(); @@ -2163,7 +2163,7 @@ void HopkinsEngine::playEnding() { _objectsManager.stopBobAnimation(7); _objectsManager.setBobAnimation(8); _globals._introSpeechOffFl = true; - _talkManager.PARLER_PERSO("GM5.PE2"); + _talkManager.startAnimatedCharacterDialogue("GM5.PE2"); _globals._disableInventFl = true; do diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index f63b4a2adc..912980ce69 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -2261,8 +2261,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int smoothIdx = 0; int stepCount = 0; while (curX > destX && destY > curY) { - int v25 = _vm->_globals.Hopkins[hopkinsIdx].field0; - int v40 = _vm->_globals.Hopkins[hopkinsIdx].field2; + int v25 = _vm->_globals._hopkinsItem[hopkinsIdx]._speedX; + int v40 = _vm->_globals._hopkinsItem[hopkinsIdx]._speedY; int spriteSize = _vm->_globals._spriteSize[curY]; if (spriteSize < 0) { v25 = _vm->_graphicsManager.zoomOut(v25, -spriteSize); @@ -2295,8 +2295,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int smoothIdx = 0; int stepCount = 0; while (curX < destX && destY > curY) { - int v14 = _vm->_globals.Hopkins[hopkinsIdx].field0; - int v39 = _vm->_globals.Hopkins[hopkinsIdx].field2; + int v14 = _vm->_globals._hopkinsItem[hopkinsIdx]._speedX; + int v39 = _vm->_globals._hopkinsItem[hopkinsIdx]._speedY; int spriteSize = _vm->_globals._spriteSize[curY]; if (spriteSize < 0) { v14 = _vm->_graphicsManager.zoomOut(v14, -spriteSize); @@ -2329,8 +2329,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int smoothIdx = 0; int stepCount = 0; while (curX > destX && destY < curY) { - int v11 = _vm->_graphicsManager.zoomOut(_vm->_globals.Hopkins[hopkinsIdx].field0, 25); - int v38 = _vm->_graphicsManager.zoomOut(_vm->_globals.Hopkins[hopkinsIdx].field2, 25); + int v11 = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedX, 25); + int v38 = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedY, 25); int oldY = curY; for (int v12 = 0; v12 < v11; v12++) { --curX; @@ -2357,8 +2357,8 @@ bool LinesManager::makeSmoothMove(int fromX, int fromY, int destX, int destY) { int stepCount = 0; while (curX < destX && destY < curY) { int oldY = curY; - int v7 = _vm->_graphicsManager.zoomOut(_vm->_globals.Hopkins[hopkinsIdx].field0, 25); - int v37 = _vm->_graphicsManager.zoomOut(_vm->_globals.Hopkins[hopkinsIdx].field2, 25); + int v7 = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedX, 25); + int v37 = _vm->_graphicsManager.zoomOut(_vm->_globals._hopkinsItem[hopkinsIdx]._speedY, 25); for (int i = 0; i < v7; i++) { ++curX; _smoothRoute[smoothIdx]._posX = curX; diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 575c34caa7..db9020b455 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -1339,8 +1339,8 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 24; } else { - int deltaX = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field0; - int deltaY = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2; + int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; + int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); @@ -1363,8 +1363,8 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 24; } else { - int deltaX = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field0; - int deltaY = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2; + int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; + int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1386,7 +1386,7 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 0; } else { - int deltaY = abs(_vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2); + int deltaY = abs(_vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY); if (_sprite[0]._zoomFactor < 0) { deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); } else if (_sprite[0]._zoomFactor > 0) { @@ -1407,7 +1407,7 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 48; } else { - int deltaY = abs(_vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2); + int deltaY = abs(_vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY); if (_sprite[0]._zoomFactor < 0) { deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); } else if (_sprite[0]._zoomFactor > 0) { @@ -1427,8 +1427,8 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 12; } else { - int deltaX = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field0; - int deltaY = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2; + int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; + int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1451,8 +1451,8 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 12; } else { - int deltaX = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field0; - int deltaY = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2; + int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; + int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1474,8 +1474,8 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 36; } else { - int deltaX = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field0; - int deltaY = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2; + int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; + int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1498,8 +1498,8 @@ void ObjectsManager::GOHOME() { oldPosY = _oldCharacterPosY; oldFrameIdx = 36; } else { - int deltaX = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field0; - int deltaY = _vm->_globals.Hopkins[_vm->_globals._oldFrameIndex].field2; + int deltaX = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedX; + int deltaY = _vm->_globals._hopkinsItem[_vm->_globals._oldFrameIndex]._speedY; if (_sprite[0]._zoomFactor < 0) { deltaX = _vm->_graphicsManager.zoomOut(deltaX, -_sprite[0]._zoomFactor); deltaY = _vm->_graphicsManager.zoomOut(deltaY, -_sprite[0]._zoomFactor); @@ -1792,14 +1792,14 @@ void ObjectsManager::handleCityMap() { if (_vm->_globals._saveData->_data[svField170] == 1 && !_vm->_globals._saveData->_data[svField171]) { _vm->_globals._saveData->_data[svField171] = 1; _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("APPEL1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("APPEL1.pe2"); _vm->_globals._introSpeechOffFl = false; mouseButton = 0; } if (_vm->_globals._saveData->_data[svField80] == 1 && !_vm->_globals._saveData->_data[svField172]) { _vm->_globals._saveData->_data[svField172] = 1; _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("APPEL2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("APPEL2.pe2"); _vm->_globals._introSpeechOffFl = false; mouseButton = 0; _vm->_eventsManager._curMouseButton = 0; @@ -2587,7 +2587,7 @@ void ObjectsManager::handleSpecialGames() { _vm->_globals._saveData->_data[svField173] = 1; _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("flicspe1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("flicspe1.pe2"); _vm->_globals._introSpeechOffFl = false; if (_vm->_globals._censorshipFl) @@ -2698,7 +2698,7 @@ void ObjectsManager::handleSpecialGames() { _vm->_eventsManager.VBL(); while (getBobAnimDataIdx(8) != 3); _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("GM3.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("GM3.PE2"); stopBobAnimation(8); _vm->_globals._saveData->_data[svField333] = 1; _vm->_globals._disableInventFl = false; @@ -3259,7 +3259,7 @@ void ObjectsManager::SPECIAL_INI() { _vm->_globals._disableInventFl = false; _vm->_graphicsManager._noFadingFl = true; _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("MAGE1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MAGE1.pe2"); _vm->_graphicsManager._noFadingFl = true; _vm->_globals._disableInventFl = false; } diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp index ea0c728c49..1d12cf1d0f 100644 --- a/engines/hopkins/script.cpp +++ b/engines/hopkins/script.cpp @@ -513,26 +513,26 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 7: - _vm->_talkManager.PARLER_PERSO("rueh1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("rueh1.pe2"); break; case 8: - _vm->_talkManager.PARLER_PERSO("ruef1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("ruef1.pe2"); break; case 10: - _vm->_talkManager.PARLER_PERSO("bqeflic1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("bqeflic1.pe2"); break; case 11: - _vm->_talkManager.PARLER_PERSO("bqeflic2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("bqeflic2.pe2"); break; case 12: _vm->_fontManager.hideText(9); _vm->_eventsManager.VBL(); _vm->_eventsManager.VBL(); - _vm->_talkManager.PARLER_PERSO("bqetueur.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("bqetueur.pe2"); break; case 13: @@ -617,56 +617,56 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 16: - _vm->_talkManager.PARLER_PERSO("ftoubib.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("ftoubib.pe2"); break; case 17: - _vm->_talkManager.PARLER_PERSO("flic2b.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("flic2b.pe2"); break; case 18: - _vm->_talkManager.PARLER_PERSO("fjour.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("fjour.pe2"); break; case 20: - _vm->_talkManager.PARLER_PERSO("PUNK.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("PUNK.pe2"); break; case 21: - _vm->_talkManager.PARLER_PERSO("MEDLEG.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MEDLEG.pe2"); break; case 22: - _vm->_talkManager.OBJET_VIVANT("CADAVRE1.pe2"); + _vm->_talkManager.animateObject("CADAVRE1.pe2"); break; case 23: - _vm->_talkManager.PARLER_PERSO2("CHERCHE1.pe2"); + _vm->_talkManager.startStaticCharacterDialogue("CHERCHE1.pe2"); break; case 25: - _vm->_talkManager.PARLER_PERSO("AGENT1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("AGENT1.pe2"); break; case 26: - _vm->_talkManager.PARLER_PERSO("AGENT2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("AGENT2.pe2"); break; case 27: if (_vm->_globals._saveData->_data[svField94] != 1 || _vm->_globals._saveData->_data[svField95] != 1) - _vm->_talkManager.PARLER_PERSO("STANDAR.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("STANDAR.pe2"); else - _vm->_talkManager.PARLER_PERSO("STANDAR1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("STANDAR1.pe2"); break; case 29: _vm->_globals._disableInventFl = true; - _vm->_talkManager.OBJET_VIVANT("TELEP.pe2"); + _vm->_talkManager.animateObject("TELEP.pe2"); _vm->_globals._disableInventFl = false; break; case 32: - _vm->_talkManager.PARLER_PERSO("SAMAN.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("SAMAN.pe2"); break; case 35: @@ -678,22 +678,22 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager.VBL(); } while (_vm->_soundManager._soundFl); } - _vm->_talkManager.PARLER_PERSO("PTLAB.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("PTLAB.pe2"); break; case 36: if (_vm->_globals._saveData->_data[svField270] == 2 && _vm->_globals._saveData->_data[svField94] == 1 && _vm->_globals._saveData->_data[svField95] == 1) _vm->_globals._saveData->_data[svField270] = 3; if (!_vm->_globals._saveData->_data[svField270]) - _vm->_talkManager.PARLER_PERSO2("PATRON0.pe2"); + _vm->_talkManager.startStaticCharacterDialogue("PATRON0.pe2"); if (_vm->_globals._saveData->_data[svField270] == 1) - _vm->_talkManager.PARLER_PERSO2("PATRON1.pe2"); + _vm->_talkManager.startStaticCharacterDialogue("PATRON1.pe2"); if (_vm->_globals._saveData->_data[svField270] == 2) - _vm->_talkManager.PARLER_PERSO2("PATRON2.pe2"); + _vm->_talkManager.startStaticCharacterDialogue("PATRON2.pe2"); if (_vm->_globals._saveData->_data[svField270] == 3) - _vm->_talkManager.PARLER_PERSO2("PATRON3.pe2"); + _vm->_talkManager.startStaticCharacterDialogue("PATRON3.pe2"); if (_vm->_globals._saveData->_data[svField270] > 3) { - _vm->_talkManager.PARLER_PERSO2("PATRON4.pe2"); + _vm->_talkManager.startStaticCharacterDialogue("PATRON4.pe2"); _vm->_globals._saveData->_data[svField270] = 5; } break; @@ -720,27 +720,27 @@ int ScriptManager::handleOpcode(byte *dataP) { break; case 40: - _vm->_talkManager.PARLER_PERSO("MAGE.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MAGE.pe2"); break; case 41: - _vm->_talkManager.PARLER_PERSO("MORT3.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MORT3.pe2"); break; case 42: - _vm->_talkManager.PARLER_PERSO("MORT2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MORT2.pe2"); break; case 43: - _vm->_talkManager.PARLER_PERSO("MORT1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MORT1.pe2"); break; case 44: - _vm->_talkManager.PARLER_PERSO("MORT3A.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("MORT3A.pe2"); break; case 45: - _vm->_talkManager.PARLER_PERSO("FEM3.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("FEM3.pe2"); break; case 46: { @@ -818,11 +818,11 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 47: - _vm->_talkManager.PARLER_PERSO("BARMAN.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("BARMAN.pe2"); break; case 48: - _vm->_talkManager.PARLER_PERSO("SAMAN2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("SAMAN2.pe2"); break; case 49: { @@ -903,16 +903,16 @@ int ScriptManager::handleOpcode(byte *dataP) { case 52: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("GARDE.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("GARDE.PE2"); _vm->_globals._introSpeechOffFl = false; break; case 53: - _vm->_talkManager.PARLER_PERSO("GARDE1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("GARDE1.pe2"); break; case 54: - _vm->_talkManager.PARLER_PERSO("GARDE2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("GARDE2.pe2"); break; case 55: @@ -946,7 +946,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 58: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("Gm1.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("Gm1.PE2"); _vm->_globals._saveData->_data[svField176] = 1; _vm->_globals._saveData->_data[svField270] = 2; _vm->_globals._introSpeechOffFl = false; @@ -1002,11 +1002,11 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 62: - _vm->_talkManager.OBJET_VIVANT("SBCADA.pe2"); + _vm->_talkManager.animateObject("SBCADA.pe2"); break; case 65: - _vm->_talkManager.OBJET_VIVANT("ScCADA.pe2"); + _vm->_talkManager.animateObject("ScCADA.pe2"); break; case 80: { @@ -1117,12 +1117,12 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 83: - _vm->_talkManager.PARLER_PERSO("CVIGIL.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("CVIGIL.pe2"); break; case 84: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("CVIGIL1.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("CVIGIL1.PE2"); _vm->_globals._introSpeechOffFl = false; break; @@ -1145,19 +1145,19 @@ int ScriptManager::handleOpcode(byte *dataP) { case 86: if (_vm->_globals._saveData->_data[svField231] == 1) { - _vm->_talkManager.PARLER_PERSO("chotess1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("chotess1.pe2"); } else { _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("chotesse.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("chotesse.pe2"); _vm->_globals._introSpeechOffFl = false; } break; case 87: if (_vm->_globals._saveData->_data[svField188]) - _vm->_talkManager.PARLER_PERSO("stand2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("stand2.pe2"); else - _vm->_talkManager.PARLER_PERSO("stand1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("stand1.pe2"); break; case 88: @@ -1301,9 +1301,9 @@ int ScriptManager::handleOpcode(byte *dataP) { case 94: if (!_vm->_globals._saveData->_data[svField228]) - _vm->_talkManager.PARLER_PERSO("flicn.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("flicn.pe2"); if (_vm->_globals._saveData->_data[svField228] == 1) - _vm->_talkManager.PARLER_PERSO("flicn1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("flicn1.pe2"); break; case 95: @@ -1337,35 +1337,35 @@ int ScriptManager::handleOpcode(byte *dataP) { case 98: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("CVIGIL2.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("CVIGIL2.PE2"); _vm->_globals._introSpeechOffFl = false; break; case 100: - _vm->_talkManager.PARLER_PERSO("tourist.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("tourist.pe2"); break; case 101: - _vm->_talkManager.PARLER_PERSO("tahi1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("tahi1.pe2"); break; case 103: // Dice game _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("tourist1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("tourist1.pe2"); _vm->_globals._introSpeechOffFl = false; _vm->_animationManager.playAnim2("T421.ANM", 100, 14, 500); _vm->_eventsManager.VBL(); _vm->_eventsManager.VBL(); _vm->_eventsManager.VBL(); _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("tourist2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("tourist2.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 104: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("tourist3.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("tourist3.pe2"); _vm->_globals._introSpeechOffFl = false; break; @@ -1565,57 +1565,57 @@ int ScriptManager::handleOpcode(byte *dataP) { case 108: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("peche1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("peche1.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 109: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("peche2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("peche2.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 110: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("peche3.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("peche3.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 111: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("peche4.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("peche4.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 112: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("teint1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("teint1.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 113: - _vm->_talkManager.PARLER_PERSO("teint.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("teint.pe2"); break; case 114: - _vm->_talkManager.PARLER_PERSO("tahibar.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("tahibar.pe2"); break; case 115: - _vm->_talkManager.PARLER_PERSO("ilebar.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("ilebar.pe2"); break; case 116: - _vm->_talkManager.PARLER_PERSO("Profred.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("Profred.pe2"); break; case 170: - _vm->_talkManager.PARLER_PERSO("GRED.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("GRED.pe2"); break; case 171: { _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("gred1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("gred1.pe2"); _vm->_globals._introSpeechOffFl = false; _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); @@ -1638,12 +1638,12 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 172: - _vm->_talkManager.PARLER_PERSO("GBLEU.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("GBLEU.pe2"); break; case 173: { _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("gbleu1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("gbleu1.pe2"); _vm->_globals._introSpeechOffFl = false; _vm->_globals.NOT_VERIF = true; _vm->_objectsManager._oldCharacterPosX = _vm->_objectsManager.getSpriteX(0); @@ -1666,7 +1666,7 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 174: - _vm->_talkManager.PARLER_PERSO("Profbl.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("Profbl.pe2"); break; case 175: @@ -1718,19 +1718,19 @@ int ScriptManager::handleOpcode(byte *dataP) { case 176: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("gred2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("gred2.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 177: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("gbleu2.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("gbleu2.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 200: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("Gm2.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("Gm2.PE2"); _vm->_globals._introSpeechOffFl = false; break; @@ -1748,7 +1748,7 @@ int ScriptManager::handleOpcode(byte *dataP) { case 202: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("SVGARD2.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("SVGARD2.PE2"); _vm->_globals._introSpeechOffFl = false; break; @@ -1812,7 +1812,7 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 207: - _vm->_talkManager.OBJET_VIVANT("PANNEAU.PE2"); + _vm->_talkManager.animateObject("PANNEAU.PE2"); break; case 208: { @@ -1925,13 +1925,13 @@ int ScriptManager::handleOpcode(byte *dataP) { case 215: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("aviat.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("aviat.pe2"); _vm->_globals._introSpeechOffFl = false; break; case 216: _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("aviat1.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("aviat1.pe2"); _vm->_globals._introSpeechOffFl = false; break; @@ -1998,7 +1998,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.getBobAnimDataIdx(12) != 6); _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("PRMORT.pe2"); + _vm->_talkManager.startAnimatedCharacterDialogue("PRMORT.pe2"); _vm->_globals._introSpeechOffFl = false; do { if (_vm->shouldQuit()) @@ -2034,7 +2034,7 @@ int ScriptManager::handleOpcode(byte *dataP) { _vm->_eventsManager.VBL(); } while (_vm->_objectsManager.getBobAnimDataIdx(13) != 48); _vm->_globals._introSpeechOffFl = true; - _vm->_talkManager.PARLER_PERSO("HRADIO.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("HRADIO.PE2"); _vm->_globals._introSpeechOffFl = false; _vm->_graphicsManager.fadeOutLong(); _vm->_objectsManager.stopBobAnimation(13); @@ -2188,7 +2188,7 @@ int ScriptManager::handleOpcode(byte *dataP) { } case 241: - _vm->_talkManager.PARLER_PERSO("RECEP.PE2"); + _vm->_talkManager.startAnimatedCharacterDialogue("RECEP.PE2"); break; // Resurrect Samantha's clone diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index c6d83ee8d3..f3d753e3e5 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -49,7 +49,7 @@ void TalkManager::setParent(HopkinsEngine *vm) { _vm = vm; } -void TalkManager::PARLER_PERSO(const Common::String &filename) { +void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename) { Common::String spriteFilename; _vm->_fontManager.hideText(5); @@ -64,7 +64,9 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { _characterBuffer = _vm->_fileManager.loadFile(filename); _characterSize = _vm->_fileManager.fileSize(filename); } + // CHECKME:_data[svField4] is useless? _vm->_globals._saveData->_data[svField4] = 0; + getStringFromBuffer(40, spriteFilename, (const char *)_characterBuffer); getStringFromBuffer(0, _questionsFilename, (const char *)_characterBuffer); getStringFromBuffer(20, _answersFilename, (const char *)_characterBuffer); @@ -152,7 +154,7 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { _vm->_graphicsManager._scrollStatus = 0; } -void TalkManager::PARLER_PERSO2(const Common::String &filename) { +void TalkManager::startStaticCharacterDialogue(const Common::String &filename) { // TODO: The original disables the mouse cursor here bool oldDisableInventFl = _vm->_globals._disableInventFl; _vm->_globals._disableInventFl = true; @@ -163,7 +165,9 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { _characterSize = _vm->_fileManager.fileSize(filename); } + // CHECKME:_data[svField4] is useless? _vm->_globals._saveData->_data[svField4] = 0; + getStringFromBuffer(0, _questionsFilename, (const char *)_characterBuffer); getStringFromBuffer(20, _answersFilename, (const char *)_characterBuffer); @@ -217,7 +221,7 @@ void TalkManager::PARLER_PERSO2(const Common::String &filename) { _vm->_eventsManager.changeMouseCursor(oldMouseCursorId); _vm->_graphicsManager.initColorTable(145, 150, _vm->_graphicsManager._palette); _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette); - // TODO: The original reenables the mouse cursor here + // TODO: The original re-enables the mouse cursor here _vm->_globals._disableInventFl = oldDisableInventFl; } @@ -342,14 +346,15 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { _dialogueMesgId1 = READ_LE_INT16((uint16 *)charBuf + 5); _dialogueMesgId2 = READ_LE_INT16((uint16 *)charBuf + 6); _dialogueMesgId3 = READ_LE_INT16((uint16 *)charBuf + 7); - int v6 = READ_LE_INT16((uint16 *)charBuf + 8); - int v7 = READ_LE_INT16((uint16 *)charBuf + 9); + int frameNumb = READ_LE_INT16((uint16 *)charBuf + 8); + // CHECKME:_data[svField4] is useless? + int v7 = READ_LE_INT16((uint16 *)charBuf + 9); if (v7) _vm->_globals._saveData->_data[svField4] = v7; - if (!v6) - v6 = 10; + if (!frameNumb) + frameNumb = 10; if (animatedFl) { uint16 *bufPtr = (uint16 *)_characterBuffer + 43; int curVal = READ_LE_INT16(bufPtr); @@ -384,15 +389,15 @@ int TalkManager::dialogAnswer(int idx, bool animatedFl) { _vm->_eventsManager._mouseButton = 0; if (_vm->getIsDemo()) { - for (int i = 0; i < v6; i++) { + for (int i = 0; i < frameNumb; i++) { _vm->_eventsManager.VBL(); } } else { - for (int i = 0; i < v6; i++) { + for (int i = 0; i < frameNumb; i++) { _vm->_eventsManager.VBL(); if (_vm->_eventsManager._mouseButton || _vm->_eventsManager._curMouseButton) break; - if (_vm->_eventsManager.getMouseButton() && i + 1 > abs(v6 / 5)) + if (_vm->_eventsManager.getMouseButton() && i + 1 > abs(frameNumb / 5)) break; } } @@ -959,7 +964,7 @@ void TalkManager::REPONSE2(int zone, int verb) { } } -void TalkManager::OBJET_VIVANT(const Common::String &a2) { +void TalkManager::animateObject(const Common::String &a2) { _vm->_fontManager.hideText(5); _vm->_fontManager.hideText(9); _vm->_eventsManager.VBL(); diff --git a/engines/hopkins/talk.h b/engines/hopkins/talk.h index e0fe488c28..aa5f57eaa6 100644 --- a/engines/hopkins/talk.h +++ b/engines/hopkins/talk.h @@ -68,11 +68,11 @@ public: TalkManager(); void setParent(HopkinsEngine *vm); - void PARLER_PERSO2(const Common::String &filename); - void PARLER_PERSO(const Common::String &filename); + void startStaticCharacterDialogue(const Common::String &filename); + void startAnimatedCharacterDialogue(const Common::String &filename); void REPONSE(int zone, int verb); void REPONSE2(int zone, int verb); - void OBJET_VIVANT(const Common::String &a2); + void animateObject(const Common::String &a2); }; } // End of namespace Hopkins |