From 889a564e73e824f736706345c19497007a321df7 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 3 Dec 2014 22:25:37 -0500 Subject: ACCESS: Fix definition of river data structures --- engines/access/amazon/amazon_logic.cpp | 6 +++--- engines/access/amazon/amazon_resources.cpp | 28 +++++++++++++--------------- engines/access/amazon/amazon_resources.h | 14 ++++++-------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/engines/access/amazon/amazon_logic.cpp b/engines/access/amazon/amazon_logic.cpp index 65519f3b17..039cc01342 100644 --- a/engines/access/amazon/amazon_logic.cpp +++ b/engines/access/amazon/amazon_logic.cpp @@ -1461,7 +1461,7 @@ void River::initRiver() { } _riverIndex = _vm->_riverFlag; - _topList = RIVEROBJECTTBL[_riverIndex]; + _topList = RIVER_OBJECTS[_riverIndex][RIVER_START]; updateObstacles(); riverSetPhysX(); _canoeDir = 0; @@ -1637,7 +1637,7 @@ void River::moveCanoe2() { void River::updateObstacles() { RiverStruct *cur; - for (cur = _topList; cur < RIVEROBJECTTBL[_riverIndex + 1]; ++cur) { + for (cur = _topList; cur < RIVER_OBJECTS[_riverIndex][RIVER_END]; ++cur) { int val = cur->_field1 + cur->_field3 - 1; if (val < _screenVertX) break; @@ -1646,7 +1646,7 @@ void River::updateObstacles() { _topList = cur; _botList = cur; - while (cur < RIVEROBJECTTBL[_riverIndex + 1]) { + while (cur < RIVER_OBJECTS[_riverIndex][RIVER_END]) { ++cur; val = cur->_field1 + cur->_field3 - 1; if (val < _screenVertX || (cur->_field3 >= (_screenVirtX + 319))) diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp index 8e5fccbf25..1b83e6bf70 100644 --- a/engines/access/amazon/amazon_resources.cpp +++ b/engines/access/amazon/amazon_resources.cpp @@ -1980,7 +1980,7 @@ const int DOWNRIVEROBJ[14][4] = { { 3, 700, 0, 20 } }; -RiverStruct RIVER0OBJECTS[45] = { +RiverStruct RIVER0OBJECTS[46] = { {16, 31, 6400, 0, 4, 12}, {16, 31, 6200, 0, 2, 12}, {17, 30, 6100, 0, 3, 15}, @@ -2025,12 +2025,11 @@ RiverStruct RIVER0OBJECTS[45] = { {16, 31, 910, 0, 5, 12}, {17, 30, 705, 0, 0, 15}, {16, 31, 550, 0, 4, 12}, - {17, 30, 305, 0, 2, 15} + {17, 30, 305, 0, 2, 15}, + {16, 31, 260, 0, 7, 12} }; -RiverStruct ENDRIVER0[1] = { { 16, 31, 260, 0, 7, 12 } }; - -RiverStruct RIVER1OBJECTS[49] = { +RiverStruct RIVER1OBJECTS[50] = { {16, 31, 6920, 0, 1, 12}, {16, 31, 6740, 0, 4, 12}, {17, 30, 6699, 0, 1, 15}, @@ -2079,12 +2078,11 @@ RiverStruct RIVER1OBJECTS[49] = { {16, 31, 910, 0, 7, 12}, {17, 30, 705, 0, 0, 15}, {16, 31, 550, 0, 6, 12}, - {17, 30, 305, 0, 3, 15} + {17, 30, 305, 0, 3, 15}, + { 16, 31, 260, 0, 1, 12 } }; -RiverStruct ENDRIVER1[1] = { { 16, 31, 260, 0, 1, 12 } }; - -RiverStruct RIVER2OBJECTS[53] = { +RiverStruct RIVER2OBJECTS[54] = { {16, 31, 8230, 0, 6, 12}, {16, 31, 8115, 0, 7, 12}, {17, 30, 7955, 0, 4, 15}, @@ -2137,14 +2135,14 @@ RiverStruct RIVER2OBJECTS[53] = { {16, 31, 910, 0, 5, 12}, {17, 30, 705, 0, 0, 15}, {16, 31, 550, 0, 4, 12}, - {17, 30, 305, 0, 3, 15} + {17, 30, 305, 0, 3, 15}, + {16, 31, 260, 0, 6, 12} }; -RiverStruct ENDRIVER2[1] = { { 16, 31, 260, 0, 6, 12 } }; - -RiverStruct *RIVEROBJECTTBL[6] = { - RIVER0OBJECTS, ENDRIVER0, RIVER1OBJECTS, - ENDRIVER1, RIVER2OBJECTS, ENDRIVER2 +RiverStruct *RIVER_OBJECTS[3][2] = { + { RIVER0OBJECTS, RIVER0OBJECTS + 46 - 1}, + { RIVER1OBJECTS, RIVER0OBJECTS + 50 - 1 }, + { RIVER2OBJECTS, RIVER0OBJECTS + 54 - 1 } }; const int HELP1COORDS[2][4] = { diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h index e75b78a9e3..be1dc7d05b 100644 --- a/engines/access/amazon/amazon_resources.h +++ b/engines/access/amazon/amazon_resources.h @@ -120,14 +120,12 @@ extern const byte *MAPTBL[3]; extern const int DOWNRIVEROBJ[14][4]; -extern RiverStruct RIVER0OBJECTS[45]; -extern RiverStruct ENDRIVER0[1]; -extern RiverStruct RIVER1OBJECTS[49]; -extern RiverStruct ENDRIVER1[1]; -extern RiverStruct RIVER2OBJECTS[53]; -extern RiverStruct ENDRIVER2[1]; - -extern RiverStruct *RIVEROBJECTTBL[6]; +extern RiverStruct RIVER0OBJECTS[46]; +extern RiverStruct RIVER1OBJECTS[50]; +extern RiverStruct RIVER2OBJECTS[54]; +extern RiverStruct *RIVER_OBJECTS[3][2]; +enum { RIVER_START = 0, RIVER_END = 1 }; + extern const int HELP1COORDS[2][4]; extern const int RIVER1OBJ[23][4]; -- cgit v1.2.3