aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/blue_force
diff options
context:
space:
mode:
authorPaul Gilbert2011-08-28 22:53:20 +1000
committerPaul Gilbert2011-08-28 22:53:20 +1000
commit722a9459fe65c6d129cdaf2bbe38b41195cc844f (patch)
tree096bce78864c2c37ca790a21402591c667e68c26 /engines/tsage/blue_force
parent2798c65d756e82db8eb4a58ca3db526215557333 (diff)
downloadscummvm-rg350-722a9459fe65c6d129cdaf2bbe38b41195cc844f.tar.gz
scummvm-rg350-722a9459fe65c6d129cdaf2bbe38b41195cc844f.tar.bz2
scummvm-rg350-722a9459fe65c6d129cdaf2bbe38b41195cc844f.zip
TSAGE: Added lots of original source names from debugger, further work on first game scene
Diffstat (limited to 'engines/tsage/blue_force')
-rw-r--r--engines/tsage/blue_force/blueforce_logic.cpp13
-rw-r--r--engines/tsage/blue_force/blueforce_scenes0.cpp36
-rw-r--r--engines/tsage/blue_force/blueforce_scenes1.cpp4
-rw-r--r--engines/tsage/blue_force/blueforce_scenes3.cpp29
-rw-r--r--engines/tsage/blue_force/blueforce_ui.cpp26
-rw-r--r--engines/tsage/blue_force/blueforce_ui.h3
6 files changed, 65 insertions, 46 deletions
diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp
index 60bbddbabc..9c7d66aadf 100644
--- a/engines/tsage/blue_force/blueforce_logic.cpp
+++ b/engines/tsage/blue_force/blueforce_logic.cpp
@@ -422,7 +422,7 @@ SceneExt::SceneExt(): Scene() {
void SceneExt::postInit(SceneObjectList *OwnerList) {
Scene::postInit(OwnerList);
- if (BF_GLOBALS._v4CEA2) {
+ if (BF_GLOBALS._dayNumber) {
// Blank out the bottom portion of the screen
BF_GLOBALS._interfaceY = BF_INTERFACE_Y;
@@ -441,7 +441,7 @@ void SceneExt::dispatch() {
_timerList.dispatch();
if (_field37A) {
- if ((--_field37A == 0) && BF_GLOBALS._v4CEA2) {
+ if ((--_field37A == 0) && BF_GLOBALS._dayNumber) {
if (BF_GLOBALS._v4E238 && (BF_GLOBALS._v4CF9E == 1)) {
warning("sub_1B052");
}
@@ -494,8 +494,11 @@ void SceneHandlerExt::postInit(SceneObjectList *OwnerList) {
SceneHandler::postInit(OwnerList);
// Load the low end palette data
- GLOBALS._scenePalette.loadPalette(2);
- GLOBALS._scenePalette.refresh();
+ BF_GLOBALS._scenePalette.loadPalette(2);
+ BF_GLOBALS._scenePalette.refresh();
+
+ // Setup the user interface
+ BF_GLOBALS._uiElements.setup(Common::Point(0, BF_INTERFACE_Y - 2));
}
void SceneHandlerExt::process(Event &event) {
@@ -548,8 +551,8 @@ void VisualSpeaker::proc12(Action *action) {
}
void VisualSpeaker::setText(const Common::String &msg) {
- BF_GLOBALS._events.waitForPress();
_objectList.draw();
+ BF_GLOBALS._sceneObjects->draw();
_sceneText._color1 = _color1;
_sceneText._color2 = _color2;
diff --git a/engines/tsage/blue_force/blueforce_scenes0.cpp b/engines/tsage/blue_force/blueforce_scenes0.cpp
index f1b714ec6c..f33312494a 100644
--- a/engines/tsage/blue_force/blueforce_scenes0.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes0.cpp
@@ -263,29 +263,31 @@ void Scene50::Tooltip::highlight(bool btnDown) {
update();
if (btnDown) {
- if ((BF_GLOBALS._bikiniHutState == 14) && BF_GLOBALS.getFlag(98))
+ if ((BF_GLOBALS._bookmark == bCalledToDrunkStop) && BF_GLOBALS.getFlag(beenToJRDay2))
scene->_sceneNumber = 600;
- else if (BF_GLOBALS._bikiniHutState == 5)
+ else if (BF_GLOBALS._bookmark == bBookedGreen)
scene->_sceneNumber = 410;
else {
- BF_GLOBALS._v4CEF4 = _newSceneNumber;
+ BF_GLOBALS._driveToScene = _newSceneNumber;
- switch (BF_GLOBALS._v4CEF2) {
+ switch (BF_GLOBALS._driveFromScene) {
case 330:
case 340:
case 342:
BF_GLOBALS._player.disableControl();
- if (_locationId != BF_GLOBALS._mapLocationId) {
+ BF_GLOBALS._mapLocationId = _locationId;
+
+ if (BF_GLOBALS._driveToScene == 330) {
scene->_sceneNumber = 330;
} else {
- scene->_sceneNumber = (BF_GLOBALS._v4CEA2 != 1) || (BF_GLOBALS._bikiniHutState < 1) ||
- (BF_GLOBALS._bikiniHutState >= 2) ? 342 : 340;
+ scene->_sceneNumber = (BF_GLOBALS._dayNumber != 1) || (BF_GLOBALS._bookmark < bStartOfGame) ||
+ (BF_GLOBALS._bookmark >= bCalledToDomesticViolence) ? 342 : 340;
}
break;
case 410:
case 551:
- if (BF_GLOBALS.getFlag((BF_GLOBALS._v4CEF2 == 410) ? 41 : 40)) {
+ if (BF_GLOBALS.getFlag((BF_GLOBALS._driveFromScene == 410) ? fSearchedTruck : didDrunk)) {
BF_GLOBALS._mapLocationId = _locationId;
BF_GLOBALS._player.disableControl();
scene->_sceneNumber = _newSceneNumber;
@@ -298,7 +300,7 @@ void Scene50::Tooltip::highlight(bool btnDown) {
case 300:
if (_locationId == 1) {
- BF_GLOBALS._v4CEF4 = 300;
+ BF_GLOBALS._driveToScene = 300;
_newSceneNumber = 300;
}
// Deliberate fall through to default
@@ -354,7 +356,7 @@ void Scene50::postInit(SceneObjectList *OwnerList) {
_location5.set(Rect(383, 57, 402, 70), 380, CITY_HALL_JAIL, 32);
_location7.set(Rect(128, 32, 143, 42), 800, JAMISON_RYAN, 128);
_location9.set(Rect(349, 125, 359, 132),
- (BF_GLOBALS._bikiniHutState == 13) || (BF_GLOBALS._bikiniHutState == 14) ? 551 : 550,
+ (BF_GLOBALS._bookmark == bInspectionDone) || (BF_GLOBALS._bookmark == bCalledToDrunkStop) ? 551 : 550,
BIKINI_HUT, 16);
_item.setBounds(Rect(0, 0, SCREEN_WIDTH * 2, SCREEN_HEIGHT));
@@ -424,7 +426,7 @@ void Scene50::remove() {
void Scene50::signal() {
if (_sceneMode == 1) {
// Destination selected
- if ((BF_GLOBALS._v4CEF2 == 551) && (_sceneNumber != BF_GLOBALS._v4CEF2)) {
+ if ((BF_GLOBALS._driveFromScene == 551) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
BF_GLOBALS.setFlag(109);
BF_GLOBALS.setFlag(115);
BF_GLOBALS.setFlag(121);
@@ -432,20 +434,20 @@ void Scene50::signal() {
BF_GLOBALS.setFlag(133);
}
- if ((BF_GLOBALS._v4CEF2 == 410) && (_sceneNumber != BF_GLOBALS._v4CEF2)) {
+ if ((BF_GLOBALS._driveFromScene == 410) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
BF_GLOBALS.setFlag(125);
}
- if ((BF_GLOBALS._v4CEF2 == 340) && (_sceneNumber != BF_GLOBALS._v4CEF2)) {
+ if ((BF_GLOBALS._driveFromScene == 340) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
BF_GLOBALS.setFlag(123);
}
- if ((BF_GLOBALS._v4CEF2 == 380) && (_sceneNumber != BF_GLOBALS._v4CEF2)) {
- if (BF_GLOBALS._bikiniHutState >= 4)
+ if ((BF_GLOBALS._driveFromScene == 380) && (_sceneNumber != BF_GLOBALS._driveFromScene)) {
+ if (BF_GLOBALS._bookmark >= bLauraToParamedics)
BF_GLOBALS.setFlag(129);
- if (BF_GLOBALS._bikiniHutState >= 6)
+ if (BF_GLOBALS._bookmark >= bStoppedFrankie)
BF_GLOBALS.setFlag(131);
- if (BF_GLOBALS._bikiniHutState == 3) {
+ if (BF_GLOBALS._bookmark == bArrestedGreen) {
BF_GLOBALS._v4CEA8 = 19;
_sceneNumber = 666;
}
diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp
index 650b63c24b..7cccb0d284 100644
--- a/engines/tsage/blue_force/blueforce_scenes1.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes1.cpp
@@ -176,7 +176,7 @@ void Scene100::postInit(SceneObjectList *OwnerList) {
_globals->_player.disableControl();
_index = 109;
- if (BF_GLOBALS._v4CEA2 < 6) {
+ if (BF_GLOBALS._dayNumber < 6) {
// Title
loadScene(100);
BF_GLOBALS._sound1.play(2);
@@ -191,7 +191,7 @@ void Scene100::postInit(SceneObjectList *OwnerList) {
void Scene100::signal() {
++_sceneMode;
- if (BF_GLOBALS._v4CEA2 < 6) {
+ if (BF_GLOBALS._dayNumber < 6) {
BF_GLOBALS._scenePalette.clearListeners();
BF_GLOBALS._scenePalette.loadPalette(100);
BF_GLOBALS._sceneManager.changeScene(_index);
diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp
index e49037abf9..42c5c5dcde 100644
--- a/engines/tsage/blue_force/blueforce_scenes3.cpp
+++ b/engines/tsage/blue_force/blueforce_scenes3.cpp
@@ -48,7 +48,7 @@ void Scene300::Object::startMover(CursorType action) {
void Scene300::Object17::startMover(CursorType action) {
if ((action != CURSOR_USE) || !BF_GLOBALS.getFlag(3)) {
NamedObject::startMover(action);
- } else if ((BF_GLOBALS._v4CEA2 != 2) || (BF_GLOBALS._bikiniHutState >= 12)) {
+ } else if ((BF_GLOBALS._dayNumber != 2) || (BF_GLOBALS._bookmark >= bEndDayOne)) {
Scene300 *scene = (Scene300 *)BF_GLOBALS._sceneManager._scene;
setAction(&scene->_action4);
} else {
@@ -249,10 +249,12 @@ void Scene300::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._player._moveDiff = Common::Point(3, 1);
BF_GLOBALS._player.disableControl();
+ _object8.postInit();
+ _object8.setVisage(301);
_object8.setStrip(2);
_object8.setPosition(Common::Point(300, 77));
- if ((BF_GLOBALS._v4CEA2 != 2) || (BF_GLOBALS._bikiniHutState < 12)) {
+ if ((BF_GLOBALS._dayNumber != 2) || (BF_GLOBALS._bookmark < bEndDayOne)) {
_object17.postInit();
_object17.setVisage(301);
_object17.setStrip(1);
@@ -280,13 +282,14 @@ void Scene300::postInit(SceneObjectList *OwnerList) {
//***DEBUG***
BF_GLOBALS.setFlag(2);
-BF_GLOBALS._sceneManager._previousScene = 190;
+BF_GLOBALS._sceneManager._previousScene = 315; // 190;
BF_GLOBALS._player.setVisage(190);
+BF_GLOBALS._player.setStrip(1);
switch (BF_GLOBALS._sceneManager._previousScene) {
case 50:
case 60:
- BF_GLOBALS.clearFlag(2);
+ BF_GLOBALS.clearFlag(onBike);
if (BF_GLOBALS.getFlag(3)) {
BF_GLOBALS._player.disableControl();
_sceneMode = 318;
@@ -304,7 +307,7 @@ BF_GLOBALS._player.setVisage(190);
BF_GLOBALS._player.setPosition(Common::Point(175, 50));
ADD_PLAYER_MOVER_THIS(BF_GLOBALS._player, 123, 71);
- if ((BF_GLOBALS._v4CEA2 == 2) && (BF_GLOBALS._bikiniHutState < 12))
+ if ((BF_GLOBALS._dayNumber == 2) && (BF_GLOBALS._bookmark < bEndDayOne))
setup();
} else if (!BF_GLOBALS.getFlag(3)) {
BF_GLOBALS._player.disableControl();
@@ -318,8 +321,8 @@ BF_GLOBALS._player.setVisage(190);
break;
case 315:
BF_GLOBALS._player.setPosition(Common::Point(305, 66));
- if ((BF_GLOBALS._v4CEA2 != 2) || (BF_GLOBALS._bikiniHutState >= 12)) {
- BF_GLOBALS._player.setVisage(BF_GLOBALS.getFlag(3) ? 1304 : 303);
+ if ((BF_GLOBALS._dayNumber != 2) || (BF_GLOBALS._bookmark >= bEndDayOne)) {
+ BF_GLOBALS._player.setVisage(BF_GLOBALS.getFlag(onDuty) ? 1304 : 303);
BF_GLOBALS._player.disableControl();
_sceneMode = 0;
setAction(&_sequenceManager1, this, 306, &BF_GLOBALS._player, &_object8, NULL);
@@ -344,10 +347,10 @@ void Scene300::signal() {
switch (_sceneMode) {
case 300:
BF_GLOBALS._sound1.fadeSound(33);
- BF_GLOBALS.clearFlag(2);
+ BF_GLOBALS.clearFlag(onBike);
_sceneMode = 0;
- if ((BF_GLOBALS._v4CEA2 != 1) || (BF_GLOBALS._bikiniHutState != 0)) {
+ if ((BF_GLOBALS._dayNumber != 1) || (BF_GLOBALS._bookmark != bNone)) {
signal();
} else {
_stripManager.start(3005, this);
@@ -373,7 +376,7 @@ void Scene300::signal() {
setAction(&_sequenceManager1, this, 303, &_object13, &_object1, NULL);
break;
case 305:
- if ((BF_GLOBALS._v4CEA2 == 4) || (BF_GLOBALS._v4CEA2 == 5)) {
+ if ((BF_GLOBALS._dayNumber == 4) || (BF_GLOBALS._dayNumber == 5)) {
_sceneMode = 0;
setAction(&_action3);
} else {
@@ -407,7 +410,7 @@ void Scene300::signal() {
BF_GLOBALS._sceneManager.changeScene(60);
break;
case 318:
- BF_GLOBALS.clearFlag(2);
+ BF_GLOBALS.clearFlag(onBike);
_sceneMode = 0;
signal();
break;
@@ -442,7 +445,7 @@ void Scene300::signal() {
_object13.setAction(&_sequenceManager2, NULL, 313, &_object13, &_object17, NULL);
_object14.setAction(&_sequenceManager3, this, 314, &_object14, &_object18, NULL);
- BF_GLOBALS._bikiniHutState = 12;
+ BF_GLOBALS._bookmark = bEndDayOne;
BF_GLOBALS._sound1.changeSound(33);
break;
case 2307:
@@ -504,6 +507,8 @@ void Scene300::signal() {
}
void Scene300::process(Event &event) {
+ SceneExt::process(event);
+
if ((BF_GLOBALS._player._field8E != 0) && !_eventHandler && (event.mousePos.y < (BF_INTERFACE_Y - 1))) {
Visage visage;
diff --git a/engines/tsage/blue_force/blueforce_ui.cpp b/engines/tsage/blue_force/blueforce_ui.cpp
index e27c744486..b455541dd4 100644
--- a/engines/tsage/blue_force/blueforce_ui.cpp
+++ b/engines/tsage/blue_force/blueforce_ui.cpp
@@ -83,13 +83,13 @@ void UIQuestion::setEnabled(bool flag) {
void UIScore::postInit(SceneObjectList *OwnerList) {
int xp = 266;
- _digit3.setup(1, 6, 1, 266, 180, 255);
+ _digit3.setup(1, 6, 1, xp, 180, 255);
xp += 7;
- _digit2.setup(1, 6, 1, 266, 180, 255);
+ _digit2.setup(1, 6, 1, xp, 180, 255);
xp += 7;
- _digit1.setup(1, 6, 1, 266, 180, 255);
+ _digit1.setup(1, 6, 1, xp, 180, 255);
xp += 7;
- _digit0.setup(1, 6, 1, 266, 180, 255);
+ _digit0.setup(1, 6, 1, xp, 180, 255);
}
void UIScore::draw() {
@@ -169,6 +169,11 @@ void UICollection::hide() {
_visible = false;
}
+void UICollection::show() {
+ _visible = true;
+ draw();
+}
+
void UICollection::erase() {
if (_clearScreen) {
Rect tempRect(0, BF_INTERFACE_Y, SCREEN_WIDTH, SCREEN_HEIGHT);
@@ -216,7 +221,7 @@ void UIElements::setup(const Common::Point &pt) {
_slotStart = 0;
_itemList.clear();
_scoreValue = 0;
- _field820 = 1;
+ _active = true;
UICollection::setup(pt);
hide();
@@ -224,6 +229,7 @@ void UIElements::setup(const Common::Point &pt) {
add(&_object1);
// Set up the inventory slots
+ int xp = 0;
for (int idx = 0; idx < 4; ++idx) {
UIElement *item = NULL;
switch (idx) {
@@ -241,14 +247,16 @@ void UIElements::setup(const Common::Point &pt) {
break;
}
- item->setup(9, 1, idx, idx * 63 + 2, 4, 255);
+ xp = idx * 63 + 2;
+ item->setup(9, 1, idx, xp, 4, 255);
add(item);
}
// Setup bottom-right hand buttons
- int xp = 62;
+ xp += 62;
_question.setup(1, 4, 7, xp, 16, 255);
_question.setEnabled(false);
+ add(&_question);
xp += 21;
_scrollLeft.setup(1, 4, 1, xp, 16, 255);
@@ -275,7 +283,7 @@ void UIElements::add(UIElement *obj) {
assert(_objList.size() < 12);
_objList.push_back(obj);
- obj->setPosition(Common::Point(_bounds.left + obj->_bounds.left, _bounds.top + obj->_bounds.top));
+ obj->setPosition(Common::Point(_bounds.left + obj->_position.x, _bounds.top + obj->_position.y));
GfxSurface s = obj->getFrame();
s.draw(obj->_position);
}
@@ -326,7 +334,7 @@ void UIElements::updateInventory() {
}
}
- if (_field820)
+ if (_active)
draw();
}
diff --git a/engines/tsage/blue_force/blueforce_ui.h b/engines/tsage/blue_force/blueforce_ui.h
index 15e7a760d9..809701f83e 100644
--- a/engines/tsage/blue_force/blueforce_ui.h
+++ b/engines/tsage/blue_force/blueforce_ui.h
@@ -102,6 +102,7 @@ public:
UICollection();
void setup(const Common::Point &pt);
void hide();
+ void show();
void resetClear();
void draw();
};
@@ -119,7 +120,7 @@ public:
UIInventoryScroll _scrollLeft, _scrollRight;
ASound _sound;
int _itemCount, _slotStart, _scoreValue;
- bool _field820;
+ bool _active;
Common::Array<int> _itemList;
virtual void postInit(SceneObjectList *OwnerList = NULL) { error("Wrong init() called"); }