diff options
author | Paul Gilbert | 2011-10-21 21:31:45 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-10-21 21:31:45 +1100 |
commit | 644f942309c1208b315ddca46715628c6909d5d8 (patch) | |
tree | caf27a30fe06f4dda341aa9f3cc7dcf679fbcc5a | |
parent | bf7cf225191f6d48d353d86e5866870b9b6b1074 (diff) | |
download | scummvm-rg350-644f942309c1208b315ddca46715628c6909d5d8.tar.gz scummvm-rg350-644f942309c1208b315ddca46715628c6909d5d8.tar.bz2 scummvm-rg350-644f942309c1208b315ddca46715628c6909d5d8.zip |
TSAGE: Missing synchronisation and other bugfixes for BF Scene 910
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.cpp | 62 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.h | 31 |
2 files changed, 61 insertions, 32 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index 2092234db8..7e57fc5f41 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -780,6 +780,12 @@ void Scene910::Action2::signal() { } /* Objects */ + +void Scene910::Object1::synchronize(Serializer &s) { + NamedObject::synchronize(s); + s.syncAsSint16LE(_field90); +} + bool Scene910::Object1::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; @@ -1052,7 +1058,13 @@ bool Scene910::Object4::startAction(CursorType action, Event &event) { return NamedObject::startAction(action, event); } -bool Scene910::Object8::startAction(CursorType action, Event &event) { +void Scene910::PowerCord::synchronize(Serializer &s) { + NamedObject::synchronize(s); + s.syncAsSint16LE(_field90); + s.syncAsSint16LE(_field92); +} + +bool Scene910::PowerCord::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; // the last check is used in order to replace a check on CURSOR_1000, which is replaced @@ -1097,7 +1109,7 @@ bool Scene910::Object8::startAction(CursorType action, Event &event) { return NamedObject::startAction(action, event); } -void Scene910::Object8::init(int val) { +void Scene910::PowerCord::init(int val) { NamedObject::postInit(); _field92 = val; @@ -1156,7 +1168,7 @@ bool Scene910::BreakerBox::startAction(CursorType action, Event &event) { bool Scene910::FakeWall::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; - if (action == 57) { + if (action == INV_YELLOW_CORD) { BF_GLOBALS._player.disableControl(); scene->_destPos = Common::Point(285, 114); scene->_field2DDA = 9; @@ -1223,6 +1235,12 @@ void Scene910::BreakerBoxInset::remove() { FocusObject::remove(); } +void Scene910::Object13::synchronize(Serializer &s) { + NamedObject::synchronize(s); + s.syncAsSint16LE(_field90); + s.syncAsSint16LE(_field92); +} + bool Scene910::Object13::startAction(CursorType action, Event &event) { static uint32 black = 0; Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; @@ -1395,6 +1413,12 @@ void Scene910::Object13::setupBreaker(int x, int y, int mode, int8 frameNumber) BF_GLOBALS._sceneItems.push_front(this); } +void Scene910::Object25::synchronize(Serializer &s) { + NamedObject::synchronize(s); + s.syncAsSint16LE(_field90); + s.syncAsSint16LE(_field92); +} + bool Scene910::Object25::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; @@ -1425,7 +1449,7 @@ bool Scene910::Object25::startAction(CursorType action, Event &event) { scene->_breakerBoxInset._object27.setupBreaker(182, 92, 2, BF_GLOBALS._v4CECE[14]); } else { scene->_field2DD8 = 15; - scene->_breakerBoxInset._object28.subEBD26(178, 108, 0, BF_GLOBALS._v4CECE[15]); + scene->_breakerBoxInset._object28.init(178, 108, 0, BF_GLOBALS._v4CECE[15]); } SceneItem::display(910, 12, SET_WIDTH, 312, SET_X, GLOBALS._sceneManager._scene->_sceneBounds.left + 4, @@ -1453,7 +1477,7 @@ bool Scene910::Object25::startAction(CursorType action, Event &event) { scene->_breakerBoxInset._object27.setupBreaker(182, 96, 2, BF_GLOBALS._v4CECE[14]); } else { scene->_field2DD8 = 15; - scene->_breakerBoxInset._object28.subEBD26(178, 108, 0, BF_GLOBALS._v4CECE[15]); + scene->_breakerBoxInset._object28.init(178, 108, 0, BF_GLOBALS._v4CECE[15]); } BF_GLOBALS._v4CECE[_field90] = _field92; return true; @@ -1501,7 +1525,7 @@ void Scene910::Object25::subEBBDC(int x, int y, int arg8, int argA) { scene->_breakerBoxInset._object27.setupBreaker(182, 96, 2, BF_GLOBALS._v4CECE[14]); } else { scene->_field2DD8 = 15; - scene->_breakerBoxInset._object28.subEBD26(178, 108, 0, BF_GLOBALS._v4CECE[15]); + scene->_breakerBoxInset._object28.init(178, 108, 0, BF_GLOBALS._v4CECE[15]); } } @@ -1510,7 +1534,7 @@ void Scene910::Object25::subEBBDC(int x, int y, int arg8, int argA) { BF_GLOBALS._sceneItems.push_front(this); } -bool Scene910::Object28::startAction(CursorType action, Event &event) { +bool Scene910::BlackPlug::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -1709,7 +1733,7 @@ bool Scene910::Object28::startAction(CursorType action, Event &event) { } } -void Scene910::Object28::subEBD26(int x, int y, int arg8, int8 argA) { +void Scene910::BlackPlug::init(int x, int y, int arg8, int8 argA) { NamedObject::postInit(); _field90 = arg8; _field92 = argA; @@ -1724,7 +1748,7 @@ void Scene910::Object28::subEBD26(int x, int y, int arg8, int8 argA) { BF_GLOBALS._sceneItems.push_front(this); } -void Scene910::Object28::remove() { +void Scene910::BlackPlug::remove() { BF_GLOBALS._sceneItems.remove(this); SceneObject::remove(); } @@ -1739,10 +1763,10 @@ void Scene910::GeneratorInset::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._sceneItems.push_front(this); scene->_field2DD8 = 16; - _object30.subEBD26(142, 86, 1, BF_GLOBALS._v4CECE[16]); + _blackPlug.init(142, 86, 1, BF_GLOBALS._v4CECE[16]); scene->_field2DD8 = 17; - _object31.subED6EA(BF_GLOBALS._v4CECE[17]); + _powerButton.init(BF_GLOBALS._v4CECE[17]); } void Scene910::GeneratorInset::remove() { @@ -1751,12 +1775,12 @@ void Scene910::GeneratorInset::remove() { BF_GLOBALS._player.disableControl(); scene->_sceneMode = 12; BF_GLOBALS._player.animate(ANIM_MODE_6, scene); - _object30.remove(); - _object31.remove(); + _blackPlug.remove(); + _powerButton.remove(); FocusObject::remove(); } -bool Scene910::Object31::startAction(CursorType action, Event &event) { +bool Scene910::PowerButton::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; if (action == CURSOR_USE) { @@ -1792,16 +1816,16 @@ bool Scene910::Object31::startAction(CursorType action, Event &event) { return NamedObject::startAction(action, event); } -void Scene910::Object31::remove() { +void Scene910::PowerButton::remove() { _object32.remove(); SceneObject::remove(); } -void Scene910::Object31::subED6EA(int frame) { +void Scene910::PowerButton::init(int frame) { NamedObject::postInit(); setVisage(910); - setStrip(6 + frame); - setFrame(4); + setStrip(6); + setFrame(frame + 4); setPosition(Common::Point(159, 83)); fixPriority(251); _object32.postInit(); @@ -2436,7 +2460,7 @@ void Scene910::signal() { BF_INVENTORY.setObjectScene(INV_YELLOW_CORD, 910); _yellowCord.setStrip(6); _yellowCord.setFrame(2); - _yellowCord.setPosition(Common::Point(_fakeWall._position.x - 50, _fakeWall._position.y - 4)); + _yellowCord.setPosition(Common::Point(_fakeWall._position.x - 4, _fakeWall._position.y - 50)); _yellowCord.fixPriority(50); BF_GLOBALS._v4CECC = 0; _yellowCord._field90 = 0; diff --git a/engines/tsage/blue_force/blueforce_scenes9.h b/engines/tsage/blue_force/blueforce_scenes9.h index 42fd8cd3cf..5f5854f664 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.h +++ b/engines/tsage/blue_force/blueforce_scenes9.h @@ -118,7 +118,7 @@ public: virtual void signal(); virtual void process(Event &event); virtual void dispatch(); - void synchronize(Serializer &s); + virtual void synchronize(Serializer &s); }; class Scene910: public PalettedScene { @@ -135,6 +135,7 @@ class Scene910: public PalettedScene { class Object1: public NamedObject { public: int _field90; + virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); }; class Object2: public NamedObject { @@ -149,9 +150,11 @@ class Scene910: public PalettedScene { public: virtual bool startAction(CursorType action, Event &event); }; - class Object8: public NamedObject { + class PowerCord: public NamedObject { public: int _field90, _field92; + + virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); void init(int val); @@ -170,13 +173,14 @@ class Scene910: public PalettedScene { int _field90, _field92; public: void setupBreaker(int x, int y, int mode, int8 frameNumber); + virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); virtual void remove(); }; - class Object28: public Object13 { + class BlackPlug: public Object13 { public: - void subEBD26(int x, int y, int arg8, int8 argA); + void init(int x, int y, int arg8, int8 argA); virtual bool startAction(CursorType action, Event &event); virtual void remove(); }; @@ -185,6 +189,7 @@ class Scene910: public PalettedScene { int _field90, _field92; public: void subEBBDC(int x, int y, int arg8, int argA); + virtual void synchronize(Serializer &s); virtual bool startAction(CursorType action, Event &event); virtual void remove(); }; @@ -195,23 +200,23 @@ class Scene910: public PalettedScene { Object25 _object25, _object26; public: Object13 _object27; - Object28 _object28; + BlackPlug _object28; virtual Common::String getClassName() { return "Scene910_object12"; } virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void remove(); }; - class Object31: public NamedObject { + class PowerButton: public NamedObject { public: NamedObject _object32; virtual void remove(); virtual bool startAction(CursorType action, Event &event); - void subED6EA(int frame); + void init(int frame); }; class GeneratorInset: public FocusObject { - Object28 _object30; - Object31 _object31; + BlackPlug _blackPlug; + PowerButton _powerButton; public: virtual Common::String getClassName() { return "Scene910_object29"; } virtual void postInit(SceneObjectList *OwnerList = NULL); @@ -266,7 +271,7 @@ public: Object3 _stuart; Object4 _object4; NamedObject _object5, _vent, _object7; - Object8 _blackCord, _yellowCord; + PowerCord _blackCord, _yellowCord; BreakerBox _breakerBox; FakeWall _fakeWall; BreakerBoxInset _breakerBoxInset; @@ -284,7 +289,7 @@ public: ASoundExt _sound1, _sound2; virtual void postInit(SceneObjectList *OwnerList = NULL); - void synchronize(Serializer &s); + virtual void synchronize(Serializer &s); virtual void remove(); virtual void signal(); virtual void process(Event &event); @@ -327,7 +332,7 @@ public: virtual void signal(); virtual void process(Event &event); virtual void dispatch(); - void synchronize(Serializer &s); + virtual void synchronize(Serializer &s); }; class Scene930: public PalettedScene { @@ -418,7 +423,7 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); virtual void signal(); virtual void dispatch(); - void synchronize(Serializer &s); + virtual void synchronize(Serializer &s); }; class Scene935: public PalettedScene { |