aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/blue_force/blueforce_scenes0.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tsage/blue_force/blueforce_scenes0.cpp')
-rw-r--r--engines/tsage/blue_force/blueforce_scenes0.cpp274
1 files changed, 142 insertions, 132 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes0.cpp b/engines/tsage/blue_force/blueforce_scenes0.cpp
index bb283d051e..95598babc6 100644
--- a/engines/tsage/blue_force/blueforce_scenes0.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes0.cpp
@@ -48,45 +48,45 @@ void Scene20::Action1::signal() {
BF_GLOBALS._scenePalette.addRotation(64, 127, -1, 1, this);
break;
case 2:
- scene->_object1.setVisage(22);
- scene->_object1._strip = 1;
- scene->_object1._frame = 1;
- scene->_object1.changeZoom(100);
-
- scene->_object2.setVisage(22);
- scene->_object2._strip = 2;
- scene->_object2._frame = 1;
- scene->_object2.changeZoom(100);
-
- scene->_object3.setVisage(22);
- scene->_object3._strip = 3;
- scene->_object3._frame = 1;
- scene->_object3.changeZoom(100);
-
- scene->_object4.setVisage(22);
- scene->_object4._strip = 4;
- scene->_object4._frame = 1;
- scene->_object4.changeZoom(100);
-
- scene->_object5.setVisage(22);
- scene->_object5._strip = 5;
- scene->_object5._frame = 1;
- scene->_object5.changeZoom(100);
-
- scene->_object6.setVisage(22);
- scene->_object6._strip = 6;
- scene->_object6._frame = 1;
- scene->_object6.changeZoom(100);
-
- scene->_object7.setVisage(22);
- scene->_object7._strip = 7;
- scene->_object7._frame = 1;
- scene->_object7.changeZoom(100);
-
- scene->_object8.setVisage(22);
- scene->_object8._strip = 8;
- scene->_object8._frame = 1;
- scene->_object8.changeZoom(100);
+ scene->_tsunamiWave.setVisage(22);
+ scene->_tsunamiWave._strip = 1;
+ scene->_tsunamiWave._frame = 1;
+ scene->_tsunamiWave.changeZoom(100);
+
+ scene->_letterT.setVisage(22);
+ scene->_letterT._strip = 2;
+ scene->_letterT._frame = 1;
+ scene->_letterT.changeZoom(100);
+
+ scene->_letterS.setVisage(22);
+ scene->_letterS._strip = 3;
+ scene->_letterS._frame = 1;
+ scene->_letterS.changeZoom(100);
+
+ scene->_letterU.setVisage(22);
+ scene->_letterU._strip = 4;
+ scene->_letterU._frame = 1;
+ scene->_letterU.changeZoom(100);
+
+ scene->_letterN.setVisage(22);
+ scene->_letterN._strip = 5;
+ scene->_letterN._frame = 1;
+ scene->_letterN.changeZoom(100);
+
+ scene->_letterA.setVisage(22);
+ scene->_letterA._strip = 6;
+ scene->_letterA._frame = 1;
+ scene->_letterA.changeZoom(100);
+
+ scene->_letterM.setVisage(22);
+ scene->_letterM._strip = 7;
+ scene->_letterM._frame = 1;
+ scene->_letterM.changeZoom(100);
+
+ scene->_letterI.setVisage(22);
+ scene->_letterI._strip = 8;
+ scene->_letterI._frame = 1;
+ scene->_letterI.changeZoom(100);
setDelay(1);
break;
@@ -97,12 +97,12 @@ void Scene20::Action1::signal() {
setDelay(60);
break;
case 5:
- scene->_object2.animate(ANIM_MODE_5, NULL);
- scene->_object3.animate(ANIM_MODE_5, NULL);
- scene->_object4.animate(ANIM_MODE_5, NULL);
- scene->_object5.animate(ANIM_MODE_5, NULL);
- scene->_object6.animate(ANIM_MODE_5, NULL);
- scene->_object7.animate(ANIM_MODE_5, this);
+ scene->_letterT.animate(ANIM_MODE_5, NULL);
+ scene->_letterS.animate(ANIM_MODE_5, NULL);
+ scene->_letterU.animate(ANIM_MODE_5, NULL);
+ scene->_letterN.animate(ANIM_MODE_5, NULL);
+ scene->_letterA.animate(ANIM_MODE_5, NULL);
+ scene->_letterM.animate(ANIM_MODE_5, this);
break;
case 6:
setDelay(120);
@@ -121,76 +121,76 @@ void Scene20::Action1::signal() {
void Scene20::postInit(SceneObjectList *OwnerList) {
loadScene(20);
- Scene::postInit();
+ SceneExt::postInit();
setZoomPercents(60, 85, 200, 100);
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
_scenePalette.loadPalette(1);
_scenePalette.loadPalette(22);
- _object1.postInit();
- _object1.setVisage(21);
- _object1._strip = 1;
- _object1._frame = 1;
- _object1.animate(ANIM_MODE_NONE, NULL);
- _object1.setPosition(Common::Point(62, 85));
- _object1.changeZoom(100);
-
- _object2.postInit();
- _object2.setVisage(21);
- _object2._strip = 2;
- _object2._frame = 1;
- _object2.animate(ANIM_MODE_NONE, NULL);
- _object2.setPosition(Common::Point(27, 94));
- _object2.changeZoom(100);
-
- _object3.postInit();
- _object3.setVisage(21);
- _object3._strip = 2;
- _object3._frame = 2;
- _object3.animate(ANIM_MODE_NONE, NULL);
- _object3.setPosition(Common::Point(68, 94));
- _object3.changeZoom(100);
-
- _object4.postInit();
- _object4.setVisage(21);
- _object4._strip = 2;
- _object4._frame = 3;
- _object4.animate(ANIM_MODE_NONE, NULL);
- _object4.setPosition(Common::Point(110, 94));
- _object4.changeZoom(100);
-
- _object5.postInit();
- _object5.setVisage(21);
- _object5._strip = 2;
- _object5._frame = 4;
- _object5.animate(ANIM_MODE_NONE, NULL);
- _object5.setPosition(Common::Point(154, 94));
- _object5.changeZoom(100);
-
- _object6.postInit();
- _object6.setVisage(21);
- _object6._strip = 2;
- _object6._frame = 5;
- _object6.animate(ANIM_MODE_NONE, NULL);
- _object6.setPosition(Common::Point(199, 94));
- _object6.changeZoom(100);
-
- _object7.postInit();
- _object7.setVisage(21);
- _object7._strip = 2;
- _object7._frame = 6;
- _object7.animate(ANIM_MODE_NONE, NULL);
- _object7.setPosition(Common::Point(244, 94));
- _object7.changeZoom(100);
-
- _object8.postInit();
- _object8.setVisage(21);
- _object8._strip = 2;
- _object8._frame = 7;
- _object8.animate(ANIM_MODE_NONE, NULL);
- _object8.setPosition(Common::Point(286, 94));
- _object8.changeZoom(100);
+ _tsunamiWave.postInit();
+ _tsunamiWave.setVisage(21);
+ _tsunamiWave._strip = 1;
+ _tsunamiWave._frame = 1;
+ _tsunamiWave.animate(ANIM_MODE_NONE, NULL);
+ _tsunamiWave.setPosition(Common::Point(62, 85));
+ _tsunamiWave.changeZoom(100);
+
+ _letterT.postInit();
+ _letterT.setVisage(21);
+ _letterT._strip = 2;
+ _letterT._frame = 1;
+ _letterT.animate(ANIM_MODE_NONE, NULL);
+ _letterT.setPosition(Common::Point(27, 94));
+ _letterT.changeZoom(100);
+
+ _letterS.postInit();
+ _letterS.setVisage(21);
+ _letterS._strip = 2;
+ _letterS._frame = 2;
+ _letterS.animate(ANIM_MODE_NONE, NULL);
+ _letterS.setPosition(Common::Point(68, 94));
+ _letterS.changeZoom(100);
+
+ _letterU.postInit();
+ _letterU.setVisage(21);
+ _letterU._strip = 2;
+ _letterU._frame = 3;
+ _letterU.animate(ANIM_MODE_NONE, NULL);
+ _letterU.setPosition(Common::Point(110, 94));
+ _letterU.changeZoom(100);
+
+ _letterN.postInit();
+ _letterN.setVisage(21);
+ _letterN._strip = 2;
+ _letterN._frame = 4;
+ _letterN.animate(ANIM_MODE_NONE, NULL);
+ _letterN.setPosition(Common::Point(154, 94));
+ _letterN.changeZoom(100);
+
+ _letterA.postInit();
+ _letterA.setVisage(21);
+ _letterA._strip = 2;
+ _letterA._frame = 5;
+ _letterA.animate(ANIM_MODE_NONE, NULL);
+ _letterA.setPosition(Common::Point(199, 94));
+ _letterA.changeZoom(100);
+
+ _letterM.postInit();
+ _letterM.setVisage(21);
+ _letterM._strip = 2;
+ _letterM._frame = 6;
+ _letterM.animate(ANIM_MODE_NONE, NULL);
+ _letterM.setPosition(Common::Point(244, 94));
+ _letterM.changeZoom(100);
+
+ _letterI.postInit();
+ _letterI.setVisage(21);
+ _letterI._strip = 2;
+ _letterI._frame = 7;
+ _letterI.animate(ANIM_MODE_NONE, NULL);
+ _letterI.setPosition(Common::Point(286, 94));
+ _letterI.changeZoom(100);
setAction(&_action1);
BF_GLOBALS._dialogCenter.y = 165;
@@ -209,6 +209,11 @@ void Scene50::Tooltip::synchronize(Serializer &s) {
SavedObject::synchronize(s);
_bounds.synchronize(s);
s.syncString(_msg);
+
+ if (s.getVersion() >= 10) {
+ s.syncAsSint16LE(_newSceneNumber);
+ s.syncAsSint16LE(_locationId);
+ }
}
void Scene50::Tooltip2::signal() {
@@ -239,11 +244,11 @@ void Scene50::Tooltip2::dispatch() {
}
}
-void Scene50::Tooltip::set(const Rect &bounds, int v60, const Common::String &msg, int v62) {
+void Scene50::Tooltip::set(const Rect &bounds, int sceneNum, const Common::String &msg, int locationId) {
_bounds = bounds;
- _newSceneNumber = v60;
+ _newSceneNumber = sceneNum;
_msg = msg;
- _locationId = v62;
+ _locationId = locationId;
}
void Scene50::Tooltip::update() {
@@ -261,8 +266,8 @@ void Scene50::Tooltip::update() {
void Scene50::Tooltip::highlight(bool btnDown) {
Scene50 *scene = (Scene50 *)BF_GLOBALS._sceneManager._scene;
- scene->_field382 = _newSceneNumber;
- if ((scene->_field380 != 0) || (scene->_field380 != _newSceneNumber))
+ // In the original, a variable was used, always set to 0. The check is simplified
+ if (_newSceneNumber != 0)
update();
if (btnDown) {
@@ -323,9 +328,16 @@ void Scene50::Tooltip::highlight(bool btnDown) {
/*--------------------------------------------------------------------------*/
-Scene50::Scene50(): SceneExt() {
- _field382 = 0;
- _field380 = 0;
+Scene50::Scene50() {
+ _sceneNumber = 0;
+}
+
+
+void Scene50::synchronize(Serializer &s) {
+ if (s.getVersion() >= 10) {
+ SceneExt::synchronize(s);
+ s.syncAsSint16LE(_sceneNumber);
+ }
}
void Scene50::postInit(SceneObjectList *OwnerList) {
@@ -439,11 +451,11 @@ void Scene50::signal() {
}
if ((BF_GLOBALS._driveFromScene == 410) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
- BF_GLOBALS.setFlag(125);
+ BF_GLOBALS.setFlag(f1097Frankie);
}
if ((BF_GLOBALS._driveFromScene == 340) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
- BF_GLOBALS.setFlag(123);
+ BF_GLOBALS.setFlag(f1097Marina);
}
if ((BF_GLOBALS._driveFromScene == 380) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
@@ -469,7 +481,6 @@ void Scene50::signal() {
BF_GLOBALS._player.enableControl();
BF_GLOBALS._events.setCursor(CURSOR_WALK);
_sceneMode = 0;
- _field380 = 0;
}
}
@@ -477,7 +488,6 @@ void Scene50::process(Event &event) {
SceneExt::process(event);
Common::Point pt(event.mousePos.x + _sceneBounds.left, event.mousePos.y + _sceneBounds.top);
bool mouseDown = false;
- _field382 = 0;
if ((event.mousePos.x > 270 && (_sceneBounds.right < (SCREEN_WIDTH * 2))))
loadBackground(4, 0);
@@ -537,7 +547,7 @@ bool Scene60::Ignition::startAction(CursorType action, Event &event) {
bool Scene60::Ignition::check1() {
if (BF_GLOBALS._bookmark >= bStoppedFrankie) {
- BF_GLOBALS._v5098C |= 1;
+ BF_GLOBALS._subFlagBitArr1 |= 1;
return false;
} else {
if ((BF_GLOBALS._bookmark == bBookedGreen) && BF_GLOBALS.getFlag(fArrivedAtGangStop)) {
@@ -564,13 +574,13 @@ bool Scene60::Ignition::check1() {
} else if (BF_GLOBALS._bookmark < bStartOfGame) {
// Should never reach here
} else if (BF_GLOBALS._bookmark < bCalledToDomesticViolence) {
- if ((BF_GLOBALS._v5098C >> 1) & 1)
+ if ((BF_GLOBALS._subFlagBitArr1 >> 1) & 1)
BF_GLOBALS.setFlag(fLateToMarina);
else
- BF_GLOBALS._v5098C |= 2;
+ BF_GLOBALS._subFlagBitArr1 |= 2;
} else {
- int v = (((BF_GLOBALS._v5098C >> 2) & 15) + 1) & 15;
- BF_GLOBALS._v5098C = (BF_GLOBALS._v5098C & 0xC3) | (v << 2);
+ int v = (((BF_GLOBALS._subFlagBitArr1 >> 2) & 15) + 1) & 15;
+ BF_GLOBALS._subFlagBitArr1 = (BF_GLOBALS._subFlagBitArr1 & 0xC3) | (v << 2);
if ((v != 1) && (v != 2)) {
BF_GLOBALS._deathReason = 19;
@@ -580,17 +590,17 @@ bool Scene60::Ignition::check1() {
}
}
- BF_GLOBALS._v5098C |= 1;
+ BF_GLOBALS._subFlagBitArr1 |= 1;
return false;
}
bool Scene60::Ignition::check2() {
switch (BF_GLOBALS._bookmark) {
case bInspectionDone:
- if (BF_GLOBALS._v5098D & 1) {
+ if (BF_GLOBALS._subFlagBitArr2 & 1) {
BF_GLOBALS.setFlag(fLateToDrunkStop);
} else {
- BF_GLOBALS._v5098D |= 1;
+ BF_GLOBALS._subFlagBitArr2 |= 1;
}
break;
case bCalledToDrunkStop:
@@ -600,7 +610,7 @@ bool Scene60::Ignition::check2() {
break;
}
- BF_GLOBALS._v5098C |= 0x80;
+ BF_GLOBALS._subFlagBitArr1 |= 0x80;
return false;
}
@@ -1083,7 +1093,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
switch (BF_GLOBALS._dayNumber) {
case 1:
- if (BF_GLOBALS.getFlag(onDuty) && (BF_GLOBALS._v5098C & 1) &&
+ if (BF_GLOBALS.getFlag(onDuty) && (BF_GLOBALS._subFlagBitArr1 & 1) &&
(BF_GLOBALS._bookmark < bStartOfGame) && (BF_GLOBALS._sceneManager._previousScene != 342)) {
setAction(&_action2);
if (BF_GLOBALS._sceneManager._previousScene == 342)
@@ -1091,7 +1101,7 @@ void Scene60::postInit(SceneObjectList *OwnerList) {
}
break;
case 2:
- if (BF_GLOBALS.getFlag(onDuty) && ((BF_GLOBALS._v5098C >> 7) & 1) &&
+ if (BF_GLOBALS.getFlag(onDuty) && ((BF_GLOBALS._subFlagBitArr1 >> 7) & 1) &&
(BF_GLOBALS._sceneManager._previousScene != 550) &&
(BF_GLOBALS._bookmark < bInspectionDone)) {
setAction(&_action3);