diff options
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/hopkins.cpp | 148 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 17 | ||||
-rw-r--r-- | engines/hopkins/lines.h | 9 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 9 |
4 files changed, 98 insertions, 85 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index ec0a8589a1..766c37bea3 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -188,7 +188,7 @@ bool HopkinsEngine::runWin95Demo() { switch (_globals._exitId) { case 1: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 2, true); break; @@ -227,7 +227,7 @@ bool HopkinsEngine::runWin95Demo() { _graphicsManager.fadeOutLong(); _globals._saveData->_data[svField170] = 1; } - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; @@ -239,7 +239,7 @@ bool HopkinsEngine::runWin95Demo() { break; case 5: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 455; if (_globals._saveData->_data[svField80]) { @@ -251,7 +251,7 @@ bool HopkinsEngine::runWin95Demo() { break; case 6: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; @@ -264,14 +264,14 @@ bool HopkinsEngine::runWin95Demo() { break; case 8: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: _globals._characterMaxPosY = 440; - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); if (_globals._saveData->_data[svField225]) _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); else @@ -283,14 +283,14 @@ bool HopkinsEngine::runWin95Demo() { break; case 11: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: _globals._characterMaxPosY = 450; - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); if (_globals._saveData->_data[svField225]) { if (_globals._language == LANG_FR) _graphicsManager.loadImage("ENDFR"); @@ -493,7 +493,7 @@ bool HopkinsEngine::runLinuxDemo() { break; case 1: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1, true); break; @@ -535,7 +535,7 @@ bool HopkinsEngine::runLinuxDemo() { _globals._saveData->_data[svField170] = 1; } - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; @@ -547,7 +547,7 @@ bool HopkinsEngine::runLinuxDemo() { break; case 5: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 455; if (_globals._saveData->_data[svField80] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); @@ -556,7 +556,7 @@ bool HopkinsEngine::runLinuxDemo() { break; case 6: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; @@ -569,13 +569,13 @@ bool HopkinsEngine::runLinuxDemo() { break; case 8: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 440; if (!_globals._saveData->_data[svField225]) @@ -589,13 +589,13 @@ bool HopkinsEngine::runLinuxDemo() { break; case 11: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 450; if (_globals._saveData->_data[svField225]) _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false); @@ -604,13 +604,13 @@ bool HopkinsEngine::runLinuxDemo() { break; case 13: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1, true); break; case 14: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1, true); break; @@ -620,7 +620,7 @@ bool HopkinsEngine::runLinuxDemo() { break; case 16: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; if (_globals._saveData->_data[svField113] == 1) { @@ -631,13 +631,13 @@ bool HopkinsEngine::runLinuxDemo() { break; case 25: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30, true); break; case 26: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30, true); @@ -831,7 +831,7 @@ bool HopkinsEngine::runFull() { switch (_globals._exitId) { case 1: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM01", "IM01", "ANIM01", "IM01", 1, true); break; @@ -878,7 +878,7 @@ bool HopkinsEngine::runFull() { _graphicsManager.fadeOutLong(); _globals._saveData->_data[svField170] = 1; } - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM03", "IM03", "ANIM03", "IM03", 2, false); break; @@ -890,7 +890,7 @@ bool HopkinsEngine::runFull() { break; case 5: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 455; if (_globals._saveData->_data[svField80] == 1) _objectsManager.PERSONAGE2("IM05", "IM05A", "ANIM05B", "IM05", 3, false); @@ -899,7 +899,7 @@ bool HopkinsEngine::runFull() { break; case 6: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM06", "IM06", "ANIM06", "IM06", 2, true); break; @@ -912,13 +912,13 @@ bool HopkinsEngine::runFull() { break; case 8: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM08", "IM08", "ANIM08", "IM08", 2, true); break; case 9: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 440; if (_globals._saveData->_data[svField225]) _objectsManager.PERSONAGE2("IM09", "IM09", "ANIM09", "IM09", 10, true); @@ -931,13 +931,13 @@ bool HopkinsEngine::runFull() { break; case 11: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 450; _objectsManager.PERSONAGE2("IM11", "IM11", "ANIM11", "IM11", 2, false); break; case 12: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 450; if (_globals._saveData->_data[svField225]) _objectsManager.PERSONAGE2("IM12", "IM12", "ANIM12", "IM12", 1, false); @@ -946,13 +946,13 @@ bool HopkinsEngine::runFull() { break; case 13: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM13", "IM13", "ANIM13", "IM13", 1, true); break; case 14: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM14", "IM14", "ANIM14", "IM14", 1, true); break; @@ -965,7 +965,7 @@ bool HopkinsEngine::runFull() { break; case 16: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; if (_globals._saveData->_data[svField113] == 1) _objectsManager.PERSONAGE2("IM16", "IM16A", "ANIM16", "IM16", 7, true); @@ -974,7 +974,7 @@ bool HopkinsEngine::runFull() { break; case 17: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 440; if (_globals._saveData->_data[svField117] == 1) _objectsManager.PERSONAGE2("IM17", "IM17A", "ANIM17", "IM17", 11, true); @@ -1005,7 +1005,7 @@ bool HopkinsEngine::runFull() { break; case 18: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM18", "IM18", "ANIM18", "IM18", 29, false); @@ -1014,7 +1014,7 @@ bool HopkinsEngine::runFull() { break; case 19: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 440; if (_globals._saveData->_data[svField123]) _objectsManager.PERSONAGE2("IM19", "IM19A", "ANIM19", "IM19", 6, true); @@ -1023,7 +1023,7 @@ bool HopkinsEngine::runFull() { break; case 20: - _linesManager._maxLineIdx = 10; + _linesManager.setMaxLineIdx(10); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM20", "IM20", "ANIM20", "IM20", 6, true); if (_globals._exitId == 17) { @@ -1044,19 +1044,19 @@ bool HopkinsEngine::runFull() { break; case 22: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM22", "IM22", "ANIM22", "IM22", 6, true); break; case 23: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM23", "IM23", "ANIM23", "IM23", 6, true); break; case 24: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; if (_globals._saveData->_data[svField181] == 1) _objectsManager.PERSONAGE2("IM24", "IM24A", "ANIM24", "IM24", 1, true); @@ -1065,7 +1065,7 @@ bool HopkinsEngine::runFull() { break; case 25: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 445; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM25", "IM25", "ANIM25", "IM25", 30, true); @@ -1074,7 +1074,7 @@ bool HopkinsEngine::runFull() { break; case 26: - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 435; if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) _objectsManager.PERSONAGE2("IM26", "IM26", "ANIM26", "IM26", 30, true); @@ -1083,7 +1083,7 @@ bool HopkinsEngine::runFull() { break; case 27: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 440; if (_globals._saveData->_data[svField177] == 1) _objectsManager.PERSONAGE2("IM27", "IM27A", "ANIM27", "IM27", 27, true); @@ -1092,7 +1092,7 @@ bool HopkinsEngine::runFull() { break; case 28: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 450; if (_globals._saveData->_data[svField166] != 1 || _globals._saveData->_data[svField167] != 1) _objectsManager.PERSONAGE2("IM28", "IM28", "ANIM28", "IM28", 1, false); @@ -1101,13 +1101,13 @@ bool HopkinsEngine::runFull() { break; case 29: - _linesManager._maxLineIdx = 50; + _linesManager.setMaxLineIdx(50); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM29", "IM29", "ANIM29", "IM29", 1, true); break; case 30: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM30", "IM30", "ANIM30", "IM30", 24, false); break; @@ -1117,7 +1117,7 @@ bool HopkinsEngine::runFull() { break; case 32: - _linesManager._maxLineIdx = 20; + _linesManager.setMaxLineIdx(20); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM32", "IM32", "ANIM32", "IM32", 2, true); break; @@ -1137,7 +1137,7 @@ bool HopkinsEngine::runFull() { case 39: case 40: case 41: { - _linesManager._maxLineIdx = 40; + _linesManager.setMaxLineIdx(40); _globals._characterMaxPosY = 435; _globals._disableInventFl = false; _globals._forestFl = true; @@ -1162,55 +1162,55 @@ bool HopkinsEngine::runFull() { break; case 51: - _linesManager._maxLineIdx = 10; + _linesManager.setMaxLineIdx(10); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM51", "IM51", "ANIM51", "IM51", 14, true); break; case 52: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM52", "IM52", "ANIM52", "IM52", 14, true); break; case 54: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM54", "IM54", "ANIM54", "IM54", 14, true); break; case 55: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 460; _objectsManager.PERSONAGE2("IM55", "IM55", "ANIM55", "IM55", 14, false); break; case 56: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM56", "IM56", "ANIM56", "IM56", 14, false); break; case 57: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM57", "IM57", "ANIM57", "IM57", 14, true); break; case 58: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM58", "IM58", "ANIM58", "IM58", 14, false); break; case 59: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM59", "IM59", "ANIM59", "IM59", 21, false); break; case 60: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM60", "IM60", "ANIM60", "IM60", 21, false); break; @@ -1222,67 +1222,67 @@ bool HopkinsEngine::runFull() { break; case 62: - _linesManager._maxLineIdx = 8; + _linesManager.setMaxLineIdx(8); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM62", "IM62", NULL, "IM62", 21, false); break; case 63: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM63", "IM63", "ANIM63", "IM63", 21, false); break; case 64: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM64", "IM64", "ANIM64", "IM64", 21, true); break; case 65: - _linesManager._maxLineIdx = 30; + _linesManager.setMaxLineIdx(30); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM65", "IM65", "ANIM65", "IM65", 21, false); break; case 66: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM66", "IM66", "ANIM66", "IM66", 21, false); break; case 67: - _linesManager._maxLineIdx = 8; + _linesManager.setMaxLineIdx(8); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM67", "IM67", NULL, "IM67", 21, false); break; case 68: - _linesManager._maxLineIdx = 8; + _linesManager.setMaxLineIdx(8); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM68", "IM68", "ANIM68", "IM68", 21, true); break; case 69: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM69", "IM69", "ANIM69", "IM69", 21, false); break; case 70: - _linesManager._maxLineIdx = 8; + _linesManager.setMaxLineIdx(8); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM70", "IM70", NULL, "IM70", 21, false); break; case 71: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 445; _objectsManager.PERSONAGE2("IM71", "IM71", "ANIM71", "IM71", 21, false); break; case 73: - _linesManager._maxLineIdx = 15; + _linesManager.setMaxLineIdx(15); _globals._characterMaxPosY = 445; if (_globals._saveData->_data[svField318] == 1) _objectsManager.PERSONAGE2("IM73", "IM73A", "ANIM73", "IM73", 21, true); @@ -1355,7 +1355,7 @@ bool HopkinsEngine::runFull() { break; case 93: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 445; if (_globals._saveData->_data[svField330]) { if (getPlatform() == Common::kPlatformLinux || getPlatform() == Common::kPlatformWindows) @@ -1371,25 +1371,25 @@ bool HopkinsEngine::runFull() { break; case 94: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 440; _objectsManager.PERSONAGE2("IM94", "IM94", "ANIM94", "IM94", 19, true); break; case 95: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM95", "IM95", "ANIM95", "IM95", 19, false); break; case 96: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM96", "IM96", "ANIM96", "IM96", 19, false); break; case 97: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM97", "IM97", "ANIM97", "IM97", 19, false); if (_globals._exitId == 18) { @@ -1407,13 +1407,13 @@ bool HopkinsEngine::runFull() { break; case 98: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM98", "IM98", "ANIM98", "IM98", 19, true); break; case 99: - _linesManager._maxLineIdx = 5; + _linesManager.setMaxLineIdx(5); _globals._characterMaxPosY = 435; _objectsManager.PERSONAGE2("IM99", "IM99", "ANIM99", "IM99", 19, true); break; diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index fe01446742..ee3c138236 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -86,7 +86,6 @@ void LinesManager::loadLines(const Common::String &file) { (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 3), (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 4), 1); - ++_linesNumb; } initRoute(); _vm->_globals.freeMemory(ptr); @@ -232,8 +231,7 @@ void LinesManager::addLine(int idx, int a2, int a3, int a4, int a5, int a6, int int v39; int v40; - if (idx > MAX_LINES) - error("Attempting to add a line obstacle > MAX_LIGNE."); + assert (idx <= MAX_LINES); if (_linesNumb < idx) _linesNumb = idx; @@ -352,6 +350,8 @@ void LinesManager::addLine(int idx, int a2, int a3, int a4, int a5, int a6, int Ligne[idx]._lineDataEndIdx = v35 + 1; Ligne[idx].field2 = a7; Ligne[idx]._direction = a2; + + ++_linesNumb; } /** @@ -3234,4 +3234,15 @@ void LinesManager::removeLine(int idx) { Ligne[idx]._lineData = (int16 *)_vm->_globals.freeMemory((byte *)Ligne[idx]._lineData); } +void LinesManager::setMaxLineIdx(int idx) { + _maxLineIdx = idx; +} + +void LinesManager::resetLastLine() { + _lastLine = 0; +} + +void LinesManager::resetLinesNumb() { + _linesNumb = 0; +} } // End of namespace Hopkins diff --git a/engines/hopkins/lines.h b/engines/hopkins/lines.h index 6098ca5034..2208ced2a1 100644 --- a/engines/hopkins/lines.h +++ b/engines/hopkins/lines.h @@ -89,6 +89,9 @@ private: SegmentItem Segment[101]; CarreZoneItem CarreZone[101]; int _currentSegmentId; + int _maxLineIdx; + int _lastLine; + int _linesNumb; int CALC_PROPRE(int idx); int checkInventoryHotspotsRow(int posX, int minZoneNum, bool lastRow); @@ -106,9 +109,6 @@ private: int TEST_LIGNE(int paramX, int paramY, int *a3, int *foundLineIdx, int *foundDataIdx); public: - int _lastLine; - int _linesNumb; - int _maxLineIdx; int16 *essai2; public: @@ -132,6 +132,9 @@ public: int MZONE(); void CARRE_ZONE(); void clearAll(); + void setMaxLineIdx(int idx); + void resetLastLine(); + void resetLinesNumb(); }; } // End of namespace Hopkins diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 48fcfb8f10..e488c24321 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -1794,7 +1794,7 @@ void ObjectsManager::loadZone(const Common::String &file) { void ObjectsManager::PLAN_BETA() { _vm->_dialogsManager._inventFl = false; _vm->_eventsManager._gameKey = KEY_NONE; - _vm->_linesManager._maxLineIdx = 1; + _vm->_linesManager.setMaxLineIdx(1); _vm->_globals._characterMaxPosY = 440; _vm->_globals.PLAN_FLAG = true; _vm->_graphicsManager._noFadingFl = false; @@ -2142,8 +2142,8 @@ void ObjectsManager::clearScreen() { _verb = 4; _zoneNum = 0; _forceZoneFl = true; - _vm->_linesManager._linesNumb = 0; - _vm->_linesManager._lastLine = 0; + _vm->_linesManager.resetLinesNumb(); + _vm->_linesManager.resetLastLine(); _vm->_linesManager._route = (int16 *)g_PTRNUL; _vm->_globals._answerBuffer = _vm->_globals.freeMemory(_vm->_globals._answerBuffer); _vm->_globals.SPRITE_ECRAN = _vm->_globals.freeMemory(_vm->_globals.SPRITE_ECRAN); @@ -3144,7 +3144,7 @@ void ObjectsManager::INILINK(const Common::String &file) { v16 = ptr + idx + 4; v32 = 0; v34 = 0; - _vm->_linesManager._linesNumb = 0; + _vm->_linesManager.resetLinesNumb(); do { v27 = (int16)READ_LE_UINT16(v16 + 2 * v32); if (v27 != -1) { @@ -3156,7 +3156,6 @@ void ObjectsManager::INILINK(const Common::String &file) { (int16)READ_LE_UINT16(v16 + 2 * v32 + 6), (int16)READ_LE_UINT16(v16 + 2 * v32 + 8), 1); - ++_vm->_linesManager._linesNumb; } v32 += 5; ++v34; |