aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-10-27 19:32:27 +1100
committerPaul Gilbert2011-10-27 19:32:27 +1100
commit44e4e16819186d45e3a1adeed311218b92bbf283 (patch)
tree224ebf5f9f2306dba61ae0e0fdee22c32d4d2820
parentf4ea6a8435c807518b2c785c28dbe898fe6ba460 (diff)
downloadscummvm-rg350-44e4e16819186d45e3a1adeed311218b92bbf283.tar.gz
scummvm-rg350-44e4e16819186d45e3a1adeed311218b92bbf283.tar.bz2
scummvm-rg350-44e4e16819186d45e3a1adeed311218b92bbf283.zip
TSAGE: Implemented walk regions enabling/disabling for Blue Force
-rw-r--r--engines/tsage/blue_force/blueforce_scenes1.cpp12
-rw-r--r--engines/tsage/blue_force/blueforce_scenes2.cpp36
-rw-r--r--engines/tsage/blue_force/blueforce_scenes3.cpp66
-rw-r--r--engines/tsage/blue_force/blueforce_scenes4.cpp46
-rw-r--r--engines/tsage/blue_force/blueforce_scenes5.cpp30
-rw-r--r--engines/tsage/blue_force/blueforce_scenes6.cpp8
-rw-r--r--engines/tsage/blue_force/blueforce_scenes7.cpp6
-rw-r--r--engines/tsage/blue_force/blueforce_scenes8.cpp20
-rw-r--r--engines/tsage/blue_force/blueforce_scenes9.cpp50
-rw-r--r--engines/tsage/core.cpp59
-rw-r--r--engines/tsage/core.h6
-rw-r--r--engines/tsage/debugger.cpp4
-rw-r--r--engines/tsage/globals.cpp3
-rw-r--r--engines/tsage/saveload.h2
14 files changed, 197 insertions, 151 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp
index e977d5fbca..425446d6fb 100644
--- a/engines/tsage/blue_force/blueforce_scenes1.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes1.cpp
@@ -877,7 +877,7 @@ bool Scene114::Door::startAction(CursorType action, Event &event) {
SceneItem::display2(114, 1);
return true;
case CURSOR_USE:
- BF_GLOBALS._walkRegions.proc2(2);
+ BF_GLOBALS._walkRegions.enableRegion(2);
BF_GLOBALS._player.disableControl();
scene->_lyle.fixPriority(-1);
scene->_sceneMode = 1140;
@@ -895,8 +895,8 @@ void Scene114::postInit(SceneObjectList *OwnerList) {
loadScene(110);
setZoomPercents(85, 80, 105, 100);
- BF_GLOBALS._walkRegions.proc1(9);
- BF_GLOBALS._walkRegions.proc1(22);
+ BF_GLOBALS._walkRegions.disableRegion(9);
+ BF_GLOBALS._walkRegions.disableRegion(22);
_door.postInit();
_door.setVisage(110);
@@ -943,10 +943,10 @@ void Scene114::postInit(SceneObjectList *OwnerList) {
_vechile.setStrip(1);
_vechile.changeZoom(77);
}
- BF_GLOBALS._walkRegions.proc1(17);
+ BF_GLOBALS._walkRegions.disableRegion(17);
}
BF_GLOBALS._sceneItems.push_front(&_vechile);
- BF_GLOBALS._walkRegions.proc1(2);
+ BF_GLOBALS._walkRegions.disableRegion(2);
if (BF_GLOBALS._sceneManager._previousScene == 115) {
BF_GLOBALS._player.setPosition(Common::Point(219, 100));
@@ -1665,7 +1665,7 @@ void Scene115::postInit(SceneObjectList *OwnerList) {
NpcMover *mover = new NpcMover();
_object4.addMover(mover, &destPos, NULL);
BF_GLOBALS._sceneItems.push_front(&_object4);
- BF_GLOBALS._walkRegions.proc1(1);
+ BF_GLOBALS._walkRegions.disableRegion(1);
} else if (BF_GLOBALS.getFlag(onDuty))
BF_GLOBALS._player.setVisage(1341);
diff --git a/engines/tsage/blue_force/blueforce_scenes2.cpp b/engines/tsage/blue_force/blueforce_scenes2.cpp
index 3af02bd463..4b26d8d604 100644
--- a/engines/tsage/blue_force/blueforce_scenes2.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes2.cpp
@@ -937,9 +937,9 @@ void Scene270::postInit(SceneObjectList *OwnerList) {
(BF_INVENTORY.getObjectScene(INV_BASEBALL_CARD) != 2) &&
(BF_INVENTORY.getObjectScene(INV_BASEBALL_CARD) != 1)) ||
((BF_GLOBALS._dayNumber == 3) && BF_GLOBALS.getFlag(fGotGreen355fTalkedToGrannyDay3))) {
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(19);
_grandma.postInit();
_grandma.setVisage(274);
@@ -1142,9 +1142,9 @@ void Scene270::signal() {
&_lyle, &_grandma, NULL);
break;
case 2718:
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(19);
_field219A = 1;
BF_GLOBALS._bookmark = bTalkedToGrannyAboutSkipsCard;
@@ -1450,9 +1450,9 @@ void Scene271::postInit(SceneObjectList *OwnerList) {
switch (BF_GLOBALS._sceneManager._previousScene) {
case 180:
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(19);
BF_GLOBALS._player.setVisage(151);
BF_GLOBALS._player.setPosition(Common::Point(348, 151));
@@ -1481,9 +1481,9 @@ void Scene271::postInit(SceneObjectList *OwnerList) {
_object6.postInit();
_object6.hide();
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(19);
_object12.postInit();
_object12.setVisage(274);
@@ -1509,9 +1509,9 @@ void Scene271::postInit(SceneObjectList *OwnerList) {
_object7.setStrip(7);
_object7.setPosition(Common::Point(48, 149));
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(19);
_object12.postInit();
_object12.setVisage(276);
@@ -1543,9 +1543,9 @@ void Scene271::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._player.setFrame(1);
BF_GLOBALS._player.setPosition(Common::Point(239, 145));
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(19);
_object12.postInit();
_object12.setVisage(274);
diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp
index 76500996ba..d1ed2cd5e6 100644
--- a/engines/tsage/blue_force/blueforce_scenes3.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes3.cpp
@@ -1114,7 +1114,7 @@ void Scene315::postInit(SceneObjectList *OwnerList) {
if (_field1B6A) {
_object8.setFrame(8);
} else {
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
}
_briefingMaterial.setDetails(24, 315, 38, 39, 40, 1);
@@ -1214,13 +1214,13 @@ void Scene315::signal() {
BF_GLOBALS._sceneManager.changeScene(325);
break;
case 3152:
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
_object7.remove();
_object6.remove();
BF_GLOBALS._player.enableControl();
_field1B68 = false;
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
T2_GLOBALS._uiElements._active = true;
T2_GLOBALS._uiElements.show();
break;
@@ -1241,7 +1241,7 @@ void Scene315::signal() {
case 3155:
BF_GLOBALS._player.enableControl();
_field1B68 = false;
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
T2_GLOBALS._uiElements._active = true;
T2_GLOBALS._uiElements.show();
break;
@@ -1723,7 +1723,7 @@ void Scene340::Action1::signal() {
if (BF_GLOBALS.getFlag(fBackupArrived340)) {
scene->_backupPresent = 1;
scene->_harrison.setPosition(Common::Point(46, 154));
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(19);
} else if (BF_GLOBALS.getFlag(fCalledBackup)) {
scene->_timer1.set(40, &scene->_harrison, &scene->_action4);
}
@@ -1818,7 +1818,7 @@ void Scene340::Action4::signal() {
BF_GLOBALS._player.setAction(&scene->_sequenceManager3, this, 1347, &scene->_harrison, NULL);
break;
case 3:
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(19);
BF_GLOBALS._player.enableControl();
remove();
break;
@@ -2012,8 +2012,8 @@ void Scene340::postInit(SceneObjectList *OwnerList) {
loadScene(340);
setZoomPercents(126, 70, 162, 100);
- BF_GLOBALS._walkRegions.proc1(13);
- BF_GLOBALS._walkRegions.proc1(15);
+ BF_GLOBALS._walkRegions.disableRegion(13);
+ BF_GLOBALS._walkRegions.disableRegion(15);
_timer2.set(2, NULL);
_stripManager.addSpeaker(&_gameTextSpeaker);
@@ -2083,11 +2083,11 @@ void Scene340::postInit(SceneObjectList *OwnerList) {
_harrison.setFrame(1);
_harrison.fixPriority(75);
- BF_GLOBALS._walkRegions.proc1(23);
+ BF_GLOBALS._walkRegions.disableRegion(23);
} else if (BF_GLOBALS.getFlag(fBackupArrived340)) {
_backupPresent = 1;
_harrison.setPosition(Common::Point(46, 154));
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(19);
} else if (BF_GLOBALS.getFlag(fCalledBackup) && (BF_GLOBALS._marinaWomanCtr > 0)) {
_timer1.set(900, &_harrison, &_action4);
}
@@ -2310,8 +2310,8 @@ void Scene342::postInit(SceneObjectList *OwnerList) {
loadScene(340);
setZoomPercents(126, 70, 162, 100);
- BF_GLOBALS._walkRegions.proc1(13);
- BF_GLOBALS._walkRegions.proc1(15);
+ BF_GLOBALS._walkRegions.disableRegion(13);
+ BF_GLOBALS._walkRegions.disableRegion(15);
_field1A1A = 0;
_timer1.set(2, NULL);
@@ -2379,7 +2379,7 @@ void Scene342::postInit(SceneObjectList *OwnerList) {
}
if (BF_GLOBALS.getFlag(fWithLyle)) {
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(19);
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
@@ -2770,7 +2770,7 @@ void Scene350::signal() {
default:
if (BF_GLOBALS.getFlag(fBackupIn350)) {
_harrison.updateAngle(BF_GLOBALS._player._position);
- BF_GLOBALS._walkRegions.proc1(19);
+ BF_GLOBALS._walkRegions.disableRegion(19);
}
BF_GLOBALS._player.enableControl();
@@ -4619,7 +4619,7 @@ bool Scene370::GreensGun::startAction(CursorType action, Event &event) {
case CURSOR_USE:
if ((BF_INVENTORY.getObjectScene(INV_HANDCUFFS) != 1) || BF_GLOBALS.getFlag(greenTaken)) {
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(3);
+ BF_GLOBALS._walkRegions.enableRegion(3);
scene->_sceneMode = 3711;
scene->setAction(&scene->_sequenceManager, scene, 3711, &BF_GLOBALS._player, this, NULL);
} else {
@@ -4648,7 +4648,7 @@ bool Scene370::Green::startAction(CursorType action, Event &event) {
scene->_stripManager.start(3717, scene);
} else {
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(3);
+ BF_GLOBALS._walkRegions.enableRegion(3);
scene->_sceneMode = 3715;
scene->setAction(&scene->_sequenceManager, scene, 3715, &BF_GLOBALS._player, this, NULL);
}
@@ -4968,7 +4968,7 @@ void Scene370::signal() {
BF_GLOBALS._player.setStrip(3);
BF_GLOBALS._sceneItems.push_front(&_laura);
- BF_GLOBALS._walkRegions.proc1(3);
+ BF_GLOBALS._walkRegions.disableRegion(3);
_harrison.setAction(NULL);
BF_GLOBALS._player.enableControl();
@@ -4978,8 +4978,8 @@ void Scene370::signal() {
break;
case 3705:
_laura.remove();
- BF_GLOBALS._walkRegions.proc2(6);
- BF_GLOBALS._walkRegions.proc2(1);
+ BF_GLOBALS._walkRegions.enableRegion(6);
+ BF_GLOBALS._walkRegions.enableRegion(1);
BF_GLOBALS._player.enableControl();
break;
case 3708:
@@ -4995,8 +4995,8 @@ void Scene370::signal() {
_sceneMode = 0;
_object5.remove();
_green.setAction(NULL);
- BF_GLOBALS._walkRegions.proc1(6);
- BF_GLOBALS._walkRegions.proc1(1);
+ BF_GLOBALS._walkRegions.disableRegion(6);
+ BF_GLOBALS._walkRegions.disableRegion(1);
break;
case 3709:
BF_GLOBALS._player.disableControl();
@@ -5010,7 +5010,7 @@ void Scene370::signal() {
_green.setAction(&_sequenceManager, this, 3701, NULL);
break;
case 3711:
- BF_GLOBALS._walkRegions.proc1(3);
+ BF_GLOBALS._walkRegions.disableRegion(3);
BF_INVENTORY.setObjectScene(INV_GREENS_GUN, 1);
T2_GLOBALS._uiElements.addScore(30);
_greensGun.remove();
@@ -5033,7 +5033,7 @@ void Scene370::signal() {
T2_GLOBALS._uiElements.addScore(50);
BF_INVENTORY.setObjectScene(INV_GREEN_ID, 1);
BF_INVENTORY.setObjectScene(INV_GREENS_KNIFE, 1);
- BF_GLOBALS._walkRegions.proc1(3);
+ BF_GLOBALS._walkRegions.disableRegion(3);
BF_GLOBALS._player.enableControl();
break;
case 3716:
@@ -5124,7 +5124,7 @@ void Scene380::postInit(SceneObjectList *OwnerList) {
setZoomPercents(68, 80, 131, 100);
BF_GLOBALS._sound1.fadeSound(33);
- BF_GLOBALS._walkRegions.proc1(9);
+ BF_GLOBALS._walkRegions.disableRegion(9);
_door.postInit();
_door.setVisage(380);
@@ -5148,13 +5148,13 @@ void Scene380::postInit(SceneObjectList *OwnerList) {
_vechile.setDetails(580, 2, 3, -1, 1, NULL);
BF_GLOBALS._player.setVisage(129);
- BF_GLOBALS._walkRegions.proc1(12);
- BF_GLOBALS._walkRegions.proc1(18);
- BF_GLOBALS._walkRegions.proc1(19);
- BF_GLOBALS._walkRegions.proc1(20);
- BF_GLOBALS._walkRegions.proc1(25);
- BF_GLOBALS._walkRegions.proc1(26);
- BF_GLOBALS._walkRegions.proc1(27);
+ BF_GLOBALS._walkRegions.disableRegion(12);
+ BF_GLOBALS._walkRegions.disableRegion(18);
+ BF_GLOBALS._walkRegions.disableRegion(19);
+ BF_GLOBALS._walkRegions.disableRegion(20);
+ BF_GLOBALS._walkRegions.disableRegion(25);
+ BF_GLOBALS._walkRegions.disableRegion(26);
+ BF_GLOBALS._walkRegions.disableRegion(27);
} else if (BF_GLOBALS.getFlag(onDuty)) {
// Show on duty motorcycle
_vechile.setStrip(2);
@@ -5304,7 +5304,7 @@ bool Scene385::Door::startAction(CursorType action, Event &event) {
switch (action) {
case CURSOR_USE:
- BF_GLOBALS._walkRegions.proc2(6);
+ BF_GLOBALS._walkRegions.enableRegion(6);
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 3850;
scene->setAction(&scene->_sequenceManager, scene, 3850, &BF_GLOBALS._player, this, NULL);
@@ -5485,7 +5485,7 @@ void Scene385::postInit(SceneObjectList *OwnerList) {
_door.setPosition(Common::Point(107, 27));
_door.setDetails(385, 0, -1, -1, 1, NULL);
- BF_GLOBALS._walkRegions.proc1(6);
+ BF_GLOBALS._walkRegions.disableRegion(6);
if (BF_GLOBALS._sceneManager._previousScene == 390) {
BF_GLOBALS._player.setPosition(Common::Point(109, 119));
diff --git a/engines/tsage/blue_force/blueforce_scenes4.cpp b/engines/tsage/blue_force/blueforce_scenes4.cpp
index c0f1aafaa3..4cff38feab 100644
--- a/engines/tsage/blue_force/blueforce_scenes4.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes4.cpp
@@ -467,7 +467,7 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) {
BF_GLOBALS._player.disableControl();
scene->_field1FBA = 1;
scene->_field1FBE = 1;
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(22);
scene->_sceneMode = 4122;
scene->_stripManager.start(4112, scene);
} else if (scene->_field1FB6 < 1) {
@@ -478,7 +478,7 @@ bool Scene410::Harrison::startAction(CursorType action, Event &event) {
BF_GLOBALS._player.disableControl();
scene->_field1FBC = 1;
scene->_field1FC0 = 1;
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(22);
scene->_sceneMode = 4109;
scene->_stripManager.start(4112, scene);
}
@@ -570,8 +570,8 @@ void Scene410::postInit(SceneObjectList *OwnerList) {
_passenger.remove();
_driver.remove();
- BF_GLOBALS._walkRegions.proc1(21);
- BF_GLOBALS._walkRegions.proc1(22);
+ BF_GLOBALS._walkRegions.disableRegion(21);
+ BF_GLOBALS._walkRegions.disableRegion(22);
_harrison.postInit();
_harrison.setVisage(343);
@@ -617,18 +617,18 @@ void Scene410::postInit(SceneObjectList *OwnerList) {
_passenger.setFrame(8);
}
- BF_GLOBALS._walkRegions.proc1(16);
+ BF_GLOBALS._walkRegions.disableRegion(16);
if (BF_GLOBALS.getFlag(fDriverOutOfTruck)) {
_driver.setVisage(417);
_driver.setStrip(1);
_driver.setPosition(Common::Point(152, 97));
- BF_GLOBALS._walkRegions.proc1(7);
+ BF_GLOBALS._walkRegions.disableRegion(7);
}
if (BF_GLOBALS.getFlag(fCalledBackup)) {
- BF_GLOBALS._walkRegions.proc1(21);
- BF_GLOBALS._walkRegions.proc1(22);
+ BF_GLOBALS._walkRegions.disableRegion(21);
+ BF_GLOBALS._walkRegions.disableRegion(22);
_harrison.postInit();
_harrison.setVisage(343);
@@ -714,7 +714,7 @@ void Scene410::signal() {
signal();
break;
case 8:
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(22);
BF_GLOBALS._player.changeAngle(225);
_harrison.changeAngle(45);
_sceneMode = 4114;
@@ -735,7 +735,7 @@ void Scene410::signal() {
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
setAction(&_sequenceManager1, this, 4100, &_passenger, &_object5, NULL);
- BF_GLOBALS._walkRegions.proc1(16);
+ BF_GLOBALS._walkRegions.disableRegion(16);
break;
case 4101:
// Driver gets out of the car
@@ -743,7 +743,7 @@ void Scene410::signal() {
_sceneMode = 0;
setAction(&_sequenceManager1, this, 4101, &_driver, &_object6, NULL);
BF_GLOBALS.setFlag(fDriverOutOfTruck);
- BF_GLOBALS._walkRegions.proc1(7);
+ BF_GLOBALS._walkRegions.disableRegion(7);
break;
case 4103:
// Click on moto to ask for backup
@@ -777,8 +777,8 @@ void Scene410::signal() {
case 4108:
BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper());
BF_GLOBALS._player.updateAngle(Common::Point(100, 170));
- BF_GLOBALS._walkRegions.proc2(22);
- BF_GLOBALS._walkRegions.proc2(16);
+ BF_GLOBALS._walkRegions.enableRegion(22);
+ BF_GLOBALS._walkRegions.enableRegion(16);
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
setAction(&_sequenceManager1, this, 4108, &_harrison, NULL);
@@ -790,7 +790,7 @@ void Scene410::signal() {
ADD_PLAYER_MOVER_NULL(BF_GLOBALS._player, 195, 139);
}
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(22);
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
setAction(&_sequenceManager1, this, 4109, &_driver, &_harrison, NULL);
@@ -810,14 +810,14 @@ void Scene410::signal() {
setAction(&_sequenceManager1, this, 4112, &_driver, &_passenger, &_harrison, NULL);
break;
case 4114:
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(22);
BF_GLOBALS._player.disableControl();
_sceneMode = 4116;
setAction(&_sequenceManager1, this, 4114, &_harrison, &_patrolCar, NULL);
break;
case 4116:
- BF_GLOBALS._walkRegions.proc2(21);
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(21);
+ BF_GLOBALS._walkRegions.enableRegion(22);
_harrison.remove();
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
@@ -839,7 +839,7 @@ void Scene410::signal() {
setAction(&_sequenceManager1, this, 4121, &BF_GLOBALS._player, &_passenger, NULL);
break;
case 4122:
- BF_GLOBALS._walkRegions.proc2(22);
+ BF_GLOBALS._walkRegions.enableRegion(22);
BF_INVENTORY.setObjectScene(INV_22_SNUB, 0);
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
@@ -1250,8 +1250,8 @@ void Scene440::postInit(SceneObjectList *OwnerList) {
_lyle.setPosition(Common::Point(135, 128));
_lyle.show();
- BF_GLOBALS._walkRegions.proc1(12);
- BF_GLOBALS._walkRegions.proc1(13);
+ BF_GLOBALS._walkRegions.disableRegion(12);
+ BF_GLOBALS._walkRegions.disableRegion(13);
} else {
_vechile.setPosition(Common::Point(169, 121));
_vechile.fixPriority(117);
@@ -1272,7 +1272,7 @@ void Scene440::postInit(SceneObjectList *OwnerList) {
}
BF_GLOBALS._sceneItems.push_back(&_vechile);
- BF_GLOBALS._walkRegions.proc1(11);
+ BF_GLOBALS._walkRegions.disableRegion(11);
_doorway.postInit();
_doorway.setVisage(440);
@@ -1575,7 +1575,7 @@ void Scene450::postInit(SceneObjectList *OwnerList) {
_object2.changeZoom(-1);
_object2.setDetails(450, 2, 18, 3, 1, NULL);
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
_weasel.postInit();
_weasel.setVisage(466);
@@ -1622,7 +1622,7 @@ void Scene450::signal() {
BF_GLOBALS.setFlag(takenWeasel);
_weasel.remove();
_object2.remove();
- BF_GLOBALS._walkRegions.proc2(4);
+ BF_GLOBALS._walkRegions.enableRegion(4);
BF_GLOBALS._player.enableControl();
break;
case 4507:
diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp
index 500cad60b1..d1f1e90234 100644
--- a/engines/tsage/blue_force/blueforce_scenes5.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes5.cpp
@@ -189,8 +189,8 @@ void Scene550::postInit(SceneObjectList *OwnerList) {
_vechile.fixPriority(70);
if (BF_GLOBALS.getFlag(fWithLyle)) {
- BF_GLOBALS._walkRegions.proc1(10);
- BF_GLOBALS._walkRegions.proc1(11);
+ BF_GLOBALS._walkRegions.disableRegion(10);
+ BF_GLOBALS._walkRegions.disableRegion(11);
_vechile.setVisage(444);
_vechile.setStrip(4);
@@ -208,7 +208,7 @@ void Scene550::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._player.setPosition(Common::Point(89, 76));
BF_GLOBALS._player.updateAngle(_lyle._position);
} else {
- BF_GLOBALS._walkRegions.proc1(12);
+ BF_GLOBALS._walkRegions.disableRegion(12);
_vechile.setPosition(Common::Point(205, 77));
_vechile.changeZoom(80);
@@ -296,8 +296,8 @@ void Scene551::Action2::signal() {
switch (_actionIndex++) {
case 0:
- BF_GLOBALS._walkRegions.proc2(18);
- BF_GLOBALS._walkRegions.proc2(4);
+ BF_GLOBALS._walkRegions.enableRegion(18);
+ BF_GLOBALS._walkRegions.enableRegion(4);
scene->_field1CD2 = 1;
scene->_harrison.setObjectWrapper(new SceneObjectWrapper());
@@ -316,7 +316,7 @@ void Scene551::Action2::signal() {
scene->_harrison.updateAngle(BF_GLOBALS._player._position);
if (scene->_drunkStanding._flag == 1) {
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
ADD_PLAYER_MOVER(71, 97);
} else {
ADD_PLAYER_MOVER(141, 87);
@@ -486,7 +486,7 @@ bool Scene551::PatrolCarTrunk::startAction(CursorType action, Event &event) {
switch (action) {
case CURSOR_USE:
if (BF_INVENTORY.getObjectScene(INV_CENTER_PUNCH) != 1) {
- BF_GLOBALS._walkRegions.proc2(18);
+ BF_GLOBALS._walkRegions.enableRegion(18);
BF_GLOBALS._player.disableControl();
scene->_sceneMode = 2;
scene->setAction(&scene->_sequenceManager, scene, 5503, &BF_GLOBALS._player, &scene->_harrison, this, NULL);
@@ -681,7 +681,7 @@ void Scene551::postInit(SceneObjectList *OwnerList) {
_vechile2.changeZoom(80);
BF_GLOBALS._sceneItems.push_back(&_vechile2);
- BF_GLOBALS._walkRegions.proc1(14);
+ BF_GLOBALS._walkRegions.disableRegion(14);
_drunk.postInit();
_drunk.setVisage(550);
@@ -812,7 +812,7 @@ void Scene551::signal() {
BF_GLOBALS._sceneManager.changeScene(60);
break;
case 2:
- BF_GLOBALS._walkRegions.proc1(18);
+ BF_GLOBALS._walkRegions.disableRegion(18);
_trunkInset.postInit();
_trunkInset.setVisage(553);
@@ -850,8 +850,8 @@ void Scene551::signal() {
setAction(&_sequenceManager, this, 5507, &BF_GLOBALS._player, &_drunk, &_drunkStanding, NULL);
break;
case 5507:
- BF_GLOBALS._walkRegions.proc1(2);
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(2);
+ BF_GLOBALS._walkRegions.disableRegion(4);
_drunkStanding._flag = 1;
BF_GLOBALS._sceneItems.push_front(&_drunkStanding);
@@ -2224,10 +2224,10 @@ void Scene580::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._player.setVisage(303);
- BF_GLOBALS._walkRegions.proc1(8);
- BF_GLOBALS._walkRegions.proc1(9);
- BF_GLOBALS._walkRegions.proc1(10);
- BF_GLOBALS._walkRegions.proc1(11);
+ BF_GLOBALS._walkRegions.disableRegion(8);
+ BF_GLOBALS._walkRegions.disableRegion(9);
+ BF_GLOBALS._walkRegions.disableRegion(10);
+ BF_GLOBALS._walkRegions.disableRegion(11);
} else {
_vechile.setPosition(Common::Point(159, 72));
diff --git a/engines/tsage/blue_force/blueforce_scenes6.cpp b/engines/tsage/blue_force/blueforce_scenes6.cpp
index 56fdec47cd..5a651d8475 100644
--- a/engines/tsage/blue_force/blueforce_scenes6.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes6.cpp
@@ -386,8 +386,8 @@ bool Scene690::Object1::startAction(CursorType action, Event &event) {
if ((action == CURSOR_USE) && (scene->_object2._strip == 1)) {
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(1);
- BF_GLOBALS._walkRegions.proc2(6);
+ BF_GLOBALS._walkRegions.enableRegion(1);
+ BF_GLOBALS._walkRegions.enableRegion(6);
scene->_sceneMode = 6901;
scene->setAction(&scene->_sequenceManager, scene, 6901, &BF_GLOBALS._player,
&scene->_object2, &scene->_object1, &scene->_object4, &scene->_object5, NULL);
@@ -500,8 +500,8 @@ void Scene690::signal() {
BF_GLOBALS._player.enableControl();
break;
case 6903:
- BF_GLOBALS._walkRegions.proc1(1);
- BF_GLOBALS._walkRegions.proc1(6);
+ BF_GLOBALS._walkRegions.disableRegion(1);
+ BF_GLOBALS._walkRegions.disableRegion(6);
BF_GLOBALS._player.enableControl();
break;
default:
diff --git a/engines/tsage/blue_force/blueforce_scenes7.cpp b/engines/tsage/blue_force/blueforce_scenes7.cpp
index 2ced7ce08c..21a27640e9 100644
--- a/engines/tsage/blue_force/blueforce_scenes7.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes7.cpp
@@ -208,7 +208,7 @@ void Scene710::signal() {
BF_GLOBALS._player.enableControl();
BF_INVENTORY.setObjectScene(INV_CRATE1, 1);
_stick.remove();
- BF_GLOBALS._walkRegions.proc2(2);
+ BF_GLOBALS._walkRegions.enableRegion(2);
break;
case 7102:
_stick.setPosition(Common::Point(100, 122));
@@ -225,7 +225,7 @@ void Scene710::signal() {
_stick._frame = 1;
}
_v1D62 = 1;
- BF_GLOBALS._walkRegions.proc1(2);
+ BF_GLOBALS._walkRegions.disableRegion(2);
if ((_v1D68 != 0) && (_sceneMode != 0))
BF_GLOBALS._player.enableControl();
break;
@@ -244,7 +244,7 @@ void Scene710::signal() {
case 7104:
_sceneMode = 7102;
setAction(&_sequenceManager1, this, 7102, &_dog, NULL);
- BF_GLOBALS._walkRegions.proc2(2);
+ BF_GLOBALS._walkRegions.enableRegion(2);
break;
case 7106:
BF_GLOBALS._sound1.fadeOut2(NULL);
diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp
index c81f3b8d65..4a52f10704 100644
--- a/engines/tsage/blue_force/blueforce_scenes8.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes8.cpp
@@ -252,12 +252,12 @@ void Scene800::postInit(SceneObjectList *OwnerList) {
_car2.fixPriority(158);
BF_GLOBALS._sceneItems.push_back(&_car2);
- BF_GLOBALS._walkRegions.proc1(8);
+ BF_GLOBALS._walkRegions.disableRegion(8);
}
if ((BF_GLOBALS._dayNumber == 4) && (BF_GLOBALS._bookmark < bEndDayThree)) {
_car2.remove();
- BF_GLOBALS._walkRegions.proc2(8);
+ BF_GLOBALS._walkRegions.enableRegion(8);
}
if (BF_GLOBALS.getFlag(fWithLyle)) {
@@ -427,7 +427,7 @@ void Scene810::Action2::signal() {
setAction(&scene->_sequenceManager1, this, 8117, &scene->_lyle, &scene->_chair, NULL);
break;
case 3:
- BF_GLOBALS._walkRegions.proc2(4);
+ BF_GLOBALS._walkRegions.enableRegion(4);
ADD_PLAYER_MOVER_THIS(scene->_lyle, 27, 124);
break;
case 4:
@@ -454,7 +454,7 @@ void Scene810::Action2::signal() {
scene->_stripManager.start(BF_GLOBALS.getFlag(onDuty) ? 8137 : 8112, this);
break;
case 8:
- BF_GLOBALS._walkRegions.proc1(13);
+ BF_GLOBALS._walkRegions.disableRegion(13);
BF_GLOBALS._player.enableControl();
remove();
break;
@@ -1172,7 +1172,7 @@ void Scene810::signal() {
if (BF_GLOBALS.getFlag(shownFax)) {
BF_GLOBALS.setFlag(showMugAround);
} else {
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
BF_GLOBALS._player.enableControl();
}
break;
@@ -1225,7 +1225,7 @@ void Scene810::signal() {
_object5.setFrame(1);
break;
case 8196:
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
BF_GLOBALS._player.enableControl();
break;
case 8198:
@@ -1279,8 +1279,8 @@ void Scene810::dispatch() {
} else {
BF_GLOBALS.clearFlag(showMugAround);
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(4);
- BF_GLOBALS._walkRegions.proc2(13);
+ BF_GLOBALS._walkRegions.enableRegion(4);
+ BF_GLOBALS._walkRegions.enableRegion(13);
_sceneMode = 8112;
setAction(&_sequenceManager1, this, 8112, &BF_GLOBALS._player, &_lyle, NULL);
@@ -1296,8 +1296,8 @@ void Scene810::dispatch() {
setAction(&_sequenceManager1, this, 8100, &BF_GLOBALS._player, NULL);
} else {
if (BF_GLOBALS.getFlag(fWithLyle)) {
- BF_GLOBALS._walkRegions.proc2(4);
- BF_GLOBALS._walkRegions.proc2(13);
+ BF_GLOBALS._walkRegions.enableRegion(4);
+ BF_GLOBALS._walkRegions.enableRegion(13);
ADD_MOVER_NULL(_lyle, 320, 155);
}
diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp
index 545edb91d6..af32e6ccc3 100644
--- a/engines/tsage/blue_force/blueforce_scenes9.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes9.cpp
@@ -77,7 +77,7 @@ bool Scene900::Gate::startAction(CursorType action, Event &event) {
} else {
scene->_sceneMode = 9005;
scene->setAction(&scene->_sequenceManager1, scene, 9005, &BF_GLOBALS._player, this, NULL);
- BF_GLOBALS._walkRegions.proc2(24);
+ BF_GLOBALS._walkRegions.enableRegion(24);
}
}
return true;
@@ -122,7 +122,7 @@ bool Scene900::Door::startAction(CursorType action, Event &event) {
SceneItem::display2(900, 1);
} else {
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(26);
+ BF_GLOBALS._walkRegions.enableRegion(26);
scene->_sceneMode = 9007;
scene->setAction(&scene->_sequenceManager1, scene, 9007, &BF_GLOBALS._player, &scene->_door, this, NULL);
}
@@ -488,7 +488,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) {
if (BF_GLOBALS._v4CEC0 == 2)
_gate.setPosition(Common::Point(758, 127));
else {
- BF_GLOBALS._walkRegions.proc1(24);
+ BF_GLOBALS._walkRegions.disableRegion(24);
_gate.setPosition(Common::Point(804, 132));
}
@@ -515,7 +515,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) {
_door._flag = 1;
if ((BF_GLOBALS._sceneManager._previousScene == 880) || (BF_GLOBALS._sceneManager._previousScene != 910)) {
- BF_GLOBALS._walkRegions.proc1(26);
+ BF_GLOBALS._walkRegions.disableRegion(26);
BF_GLOBALS._player.disableControl();
if (BF_GLOBALS._bookmark == bFinishedWGreen) {
_sceneMode = 9013;
@@ -572,7 +572,7 @@ void Scene900::signal() {
BF_GLOBALS._sceneManager.changeScene(910);
break;
case 3:
- BF_GLOBALS._walkRegions.proc1(24);
+ BF_GLOBALS._walkRegions.disableRegion(24);
_sceneMode = 9004;
setAction(&_sequenceManager1, this, 9006, &BF_GLOBALS._player, &_gate, NULL);
break;
@@ -589,7 +589,7 @@ void Scene900::signal() {
BF_GLOBALS._sceneManager.changeScene(880);
break;
case 9002:
- BF_GLOBALS._walkRegions.proc1(26);
+ BF_GLOBALS._walkRegions.disableRegion(26);
BF_GLOBALS._player.enableControl();
break;
case 9004:
@@ -606,7 +606,7 @@ void Scene900::signal() {
BF_GLOBALS._player.enableControl();
break;
case 9006:
- BF_GLOBALS._walkRegions.proc1(24);
+ BF_GLOBALS._walkRegions.disableRegion(24);
BF_GLOBALS._player.enableControl();
break;
case 9007:
@@ -1051,8 +1051,8 @@ bool Scene910::Forbes::startAction(CursorType action, Event &event) {
if (action == CURSOR_TALK) {
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(1);
- BF_GLOBALS._walkRegions.proc2(16);
+ BF_GLOBALS._walkRegions.enableRegion(1);
+ BF_GLOBALS._walkRegions.enableRegion(16);
scene->_sceneMode = 9140;
scene->setAction(&scene->_sequenceManager1, scene, 9140, &scene->_forbes, &BF_GLOBALS._player, &scene->_lyle, NULL);
return true;
@@ -2126,10 +2126,10 @@ void Scene910::postInit(SceneObjectList *OwnerList) {
_lyle._field90 = 1;
_lyle.setDetails(910, 69, 70 ,71 , 5, &_item4);
- BF_GLOBALS._walkRegions.proc1(15);
- BF_GLOBALS._walkRegions.proc1(16);
- BF_GLOBALS._walkRegions.proc1(14);
- BF_GLOBALS._walkRegions.proc1(10);
+ BF_GLOBALS._walkRegions.disableRegion(15);
+ BF_GLOBALS._walkRegions.disableRegion(16);
+ BF_GLOBALS._walkRegions.disableRegion(14);
+ BF_GLOBALS._walkRegions.disableRegion(10);
if (BF_GLOBALS.getFlag(gunDrawn)) {
BF_GLOBALS._player.setVisage(1911);
BF_GLOBALS._player.animate(ANIM_MODE_NONE, 0, NULL);
@@ -2202,14 +2202,14 @@ void Scene910::postInit(SceneObjectList *OwnerList) {
_fakeWall.setPosition(Common::Point(292, 107));
if (BF_GLOBALS._v4CECC != 2)
_yellowCord.setPosition(Common::Point(288, 57));
- BF_GLOBALS._walkRegions.proc1(10);
+ BF_GLOBALS._walkRegions.disableRegion(10);
} else {
_object5.setFrame(6);
_fakeWall.setPosition(Common::Point(295, 20));
_fakeWall.hide();
if (BF_GLOBALS._v4CECC != 2)
_yellowCord.setPosition(Common::Point(291, -30));
- BF_GLOBALS._walkRegions.proc1(10);
+ BF_GLOBALS._walkRegions.disableRegion(10);
}
if (BF_GLOBALS._v4CECE[17] != 0) {
@@ -2315,8 +2315,8 @@ void Scene910::signal() {
_sceneMode = 10;
addFader((const byte *)&black, 2, this);
BF_GLOBALS._v4CEE2 = 1;
- BF_GLOBALS._walkRegions.proc1(16);
- BF_GLOBALS._walkRegions.proc1(14);
+ BF_GLOBALS._walkRegions.disableRegion(16);
+ BF_GLOBALS._walkRegions.disableRegion(14);
BF_GLOBALS._sceneItems.remove(&_item16);
break;
case 17:
@@ -2375,7 +2375,7 @@ void Scene910::signal() {
break;
case 9100:
if (BF_GLOBALS._dayNumber == 5)
- BF_GLOBALS._walkRegions.proc1(1);
+ BF_GLOBALS._walkRegions.disableRegion(1);
BF_GLOBALS._player.enableControl();
break;
case 9101:
@@ -2490,7 +2490,7 @@ void Scene910::signal() {
BF_GLOBALS._player.enableControl();
break;
case 9120:
- BF_GLOBALS._walkRegions.proc1(7);
+ BF_GLOBALS._walkRegions.disableRegion(7);
BF_GLOBALS._player.enableControl();
break;
case 9121:
@@ -2624,7 +2624,7 @@ void Scene910::signal() {
_lyle.setAction(&_sequenceManager2, NULL, 9133, &_lyle, NULL);
BF_GLOBALS._v4CECE[14] = 3;
subE82BD();
- BF_GLOBALS._walkRegions.proc1(15);
+ BF_GLOBALS._walkRegions.disableRegion(15);
break;
case 9132:
BF_GLOBALS._player.enableControl();
@@ -2644,7 +2644,7 @@ void Scene910::signal() {
BF_GLOBALS.setFlag(fGotPointsForCuffingNico);
}
_lyle.setAction(&_sequenceManager2, NULL, 9131, &_lyle, NULL);
- BF_GLOBALS._walkRegions.proc2(16);
+ BF_GLOBALS._walkRegions.enableRegion(16);
if (BF_GLOBALS._v4CEE2 == 4)
BF_INVENTORY.setObjectScene(INV_YELLOW_CORD, 0);
else
@@ -2655,7 +2655,7 @@ void Scene910::signal() {
setAction(&_sequenceManager1, this, 9139, &_forbes, &BF_GLOBALS._player, NULL);
break;
case 9139:
- BF_GLOBALS._walkRegions.proc1(4);
+ BF_GLOBALS._walkRegions.disableRegion(4);
_field2DE0 = 1;
BF_GLOBALS._player.enableControl();
break;
@@ -2873,7 +2873,7 @@ void Scene910::subE82BD() {
}
BF_GLOBALS._v4CEE0 = 1;
BF_GLOBALS._player.disableControl();
- BF_GLOBALS._walkRegions.proc2(10);
+ BF_GLOBALS._walkRegions.enableRegion(10);
_sceneMode = 9114;
_sound2.play(42);
if ((BF_GLOBALS._v4CECC == 0) && (BF_INVENTORY.getObjectScene(INV_YELLOW_CORD) == 910))
@@ -2890,7 +2890,7 @@ void Scene910::subE83E1() {
BF_GLOBALS.setFlag(80);
}
BF_GLOBALS._v4CEE0 = 0;
- BF_GLOBALS._walkRegions.proc1(10);
+ BF_GLOBALS._walkRegions.disableRegion(10);
BF_GLOBALS._player.disableControl();
_sceneMode = 9115;
_sound2.play(42);
@@ -2910,7 +2910,7 @@ void Scene910::subE83E1() {
BF_GLOBALS._player.disableControl();
_sceneMode = 9120;
BF_GLOBALS._player.setAction(&_sequenceManager2, NULL, 9120, &BF_GLOBALS._player, &_lyle, NULL);
- BF_GLOBALS._walkRegions.proc2(1);
+ BF_GLOBALS._walkRegions.enableRegion(1);
}
}
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp
index 455550f6a4..5a51a9c9ef 100644
--- a/engines/tsage/core.cpp
+++ b/engines/tsage/core.cpp
@@ -896,24 +896,28 @@ int PlayerMover::calculateRestOfRoute(int *routeList, int srcRegion, int destReg
// Check every connected region until we find a route to the destination (or we have no more to check).
int bestDistance = 31990;
while (((currDest = g_globals->_walkRegions._idxList[srcWalkRegion._idxListIndex + foundIndex]) != 0) && (!foundRoute)) {
- int newDistance = calculateRestOfRoute(tempList, currDest, destRegion, foundRoute);
+ // Only check the region if it isn't in the list of explicitly disabled regions
+ if (!contains(g_globals->_walkRegions._disabledRegions, (int)currDest)) {
+ int newDistance = calculateRestOfRoute(tempList, currDest, destRegion, foundRoute);
- if ((newDistance <= bestDistance) || foundRoute) {
- // We found a shorter possible route, or one leading to the destination.
+ if ((newDistance <= bestDistance) || foundRoute) {
+ // We found a shorter possible route, or one leading to the destination.
- // Overwrite the route with this new one.
- routeList[0] = ourListSize - 1;
+ // Overwrite the route with this new one.
+ routeList[0] = ourListSize - 1;
- for (int i = ourListSize; i <= tempList[0]; ++i) {
- routeList[i] = tempList[i];
- ++routeList[0];
+ for (int i = ourListSize; i <= tempList[0]; ++i) {
+ routeList[i] = tempList[i];
+ ++routeList[0];
+ }
+
+ bestDistance = newDistance;
}
- bestDistance = newDistance;
+ // Truncate our local list to the size it was before the call.
+ tempList[0] = ourListSize;
}
- // Truncate our local list to the size it was before the call.
- tempList[0] = ourListSize;
++foundIndex;
}
@@ -3626,6 +3630,39 @@ int WalkRegions::indexOf(const Common::Point &pt, const Common::List<int> *index
return -1;
}
+void WalkRegions::synchronize(Serializer &s) {
+ // Synchronise the list of disabled regions as a list of values terminated with a '-1'
+ int regionId;
+ if (s.isLoading()) {
+ _disabledRegions.clear();
+
+ s.syncAsSint16LE(regionId);
+ while (regionId != -1) {
+ _disabledRegions.push_back(regionId);
+ s.syncAsSint16LE(regionId);
+ }
+ } else {
+ Common::List<int>::iterator i;
+ for (i = _disabledRegions.begin(); i != _disabledRegions.end(); ++i) {
+ regionId = *i;
+ s.syncAsSint16LE(regionId);
+ }
+
+ regionId = -1;
+ s.syncAsSint16LE(regionId);
+ }
+}
+
+void WalkRegions::disableRegion(int regionId) {
+ if (!contains(_disabledRegions, regionId))
+ _disabledRegions.push_back(regionId);
+}
+
+void WalkRegions::enableRegion(int regionId) {
+ _disabledRegions.remove(regionId);
+}
+
+
/*--------------------------------------------------------------------------*/
void ScenePriorities::load(int resNum) {
diff --git a/engines/tsage/core.h b/engines/tsage/core.h
index 40a33b49b3..1a50d0beae 100644
--- a/engines/tsage/core.h
+++ b/engines/tsage/core.h
@@ -807,8 +807,10 @@ public:
Common::Array<WRField18> _field18;
Common::Array<int> _idxList;
Common::Array<int> _idxList2;
+ Common::List<int> _disabledRegions;
public:
WalkRegions() { _resNum = -1; }
+ virtual void synchronize(Serializer &s);
void clear();
void load(int sceneNum);
@@ -817,8 +819,8 @@ public:
assert((idx >= 1) && (idx <= (int)_regionList.size()));
return _regionList[idx - 1];
}
- void proc1(int v) { warning("TODO: WalkRegions::proc1"); }
- void proc2(int v) { warning("TODO: WalkRegions::proc2"); }
+ void disableRegion(int regionId);
+ void enableRegion(int regionId);
};
/*--------------------------------------------------------------------------*/
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp
index a0e8b9edba..a099f16da3 100644
--- a/engines/tsage/debugger.cpp
+++ b/engines/tsage/debugger.cpp
@@ -95,6 +95,10 @@ bool Debugger::Cmd_WalkRegions(int argc, const char **argv) {
for (uint regionIndex = 0; regionIndex < g_globals->_walkRegions._regionList.size(); ++regionIndex, ++color) {
WalkRegion &wr = g_globals->_walkRegions._regionList[regionIndex];
+ // Skip the region if it's in the list of explicitly disabled regions
+ if (contains(g_globals->_walkRegions._disabledRegions, (int)regionIndex + 1))
+ continue;
+
for (int yp = wr._bounds.top; yp < wr._bounds.bottom; ++yp) {
LineSliceSet sliceSet = wr.getLineSlices(yp);
diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp
index 4bcee21b23..9bae180bc6 100644
--- a/engines/tsage/globals.cpp
+++ b/engines/tsage/globals.cpp
@@ -184,6 +184,9 @@ void Globals::synchronize(Serializer &s) {
s.syncAsSint16LE(_prevSceneOffset.x); s.syncAsSint16LE(_prevSceneOffset.y);
SYNC_POINTER(_scrollFollower);
s.syncAsSint32LE(_stripNum);
+
+ if (s.getVersion() >= 8)
+ _walkRegions.synchronize(s);
}
void Globals::dispatchSound(ASound *obj) {
diff --git a/engines/tsage/saveload.h b/engines/tsage/saveload.h
index 52b23413d4..207051a182 100644
--- a/engines/tsage/saveload.h
+++ b/engines/tsage/saveload.h
@@ -33,7 +33,7 @@ namespace TsAGE {
typedef void (*SaveNotifierFn)(bool postFlag);
-#define TSAGE_SAVEGAME_VERSION 7
+#define TSAGE_SAVEGAME_VERSION 8
class SavedObject;