diff options
author | Paul Gilbert | 2011-10-21 20:31:05 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-10-21 20:31:05 +1100 |
commit | bf7cf225191f6d48d353d86e5866870b9b6b1074 (patch) | |
tree | bd2647c394c35c581295b6cf0f680ff6f184f901 | |
parent | e6d0c9e1f6e94881d93889e9447136606c57f68d (diff) | |
download | scummvm-rg350-bf7cf225191f6d48d353d86e5866870b9b6b1074.tar.gz scummvm-rg350-bf7cf225191f6d48d353d86e5866870b9b6b1074.tar.bz2 scummvm-rg350-bf7cf225191f6d48d353d86e5866870b9b6b1074.zip |
TSAGE: Further cleanup and bugfixes for BF Scene 910
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.cpp | 39 | ||||
-rw-r--r-- | engines/tsage/blue_force/blueforce_scenes9.h | 8 |
2 files changed, 27 insertions, 20 deletions
diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index be8c7ac66d..2092234db8 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -1077,8 +1077,7 @@ bool Scene910::Object8::startAction(CursorType action, Event &event) { _field90 = 1; return true; } else { - scene->_field2DDC = 151; - scene->_field2DDE = 186; + scene->_destPos = Common::Point(151, 186); scene->_field2DDA = 4; scene->_sceneMode = 9123; if (BF_GLOBALS._player._visage == 1911) @@ -1159,8 +1158,7 @@ bool Scene910::FakeWall::startAction(CursorType action, Event &event) { if (action == 57) { BF_GLOBALS._player.disableControl(); - scene->_field2DDC = 285; - scene->_field2DDE = 114; + scene->_destPos = Common::Point(285, 114); scene->_field2DDA = 9; scene->_sceneMode = 9123; if (BF_GLOBALS._player._visage == 1911) @@ -1815,7 +1813,7 @@ void Scene910::Object31::subED6EA(int frame) { BF_GLOBALS._sceneItems.push_front(this); } -bool Scene910::Item1::startAction(CursorType action, Event &event) { +bool Scene910::Generator::startAction(CursorType action, Event &event) { Scene910 *scene = (Scene910 *)BF_GLOBALS._sceneManager._scene; if (action == CURSOR_USE) { @@ -1849,8 +1847,7 @@ bool Scene910::Item2::startAction(CursorType action, Event &event) { if (action == 59) { BF_GLOBALS._player.disableControl(); - scene->_field2DDC = 151; - scene->_field2DDE = 186; + scene->_destPos = Common::Point(151, 186); scene->_field2DDA = 5; scene->_sceneMode = 9123; if (BF_GLOBALS._player._visage == 1911) @@ -1908,8 +1905,7 @@ bool Scene910::Item16::startAction(CursorType action, Event &event) { if (BF_GLOBALS._player._visage == 1911) { BF_GLOBALS._player.disableControl(); - scene->_field2DDC = 292; - scene->_field2DDE = 100; + scene->_destPos = Common::Point(292, 100); scene->_field2DDA = 0; scene->_sceneMode = 9123; scene->setAction(&scene->_sequenceManager1, scene, 9123, &BF_GLOBALS._player, NULL); @@ -1934,6 +1930,18 @@ void Scene910::remove() { PalettedScene::remove(); } +void Scene910::synchronize(Serializer &s) { + PalettedScene::synchronize(s); + + s.syncAsSint16LE(_field2DDA); + s.syncAsSint16LE(_field2DD8); + s.syncAsSint16LE(_field2DE0); + s.syncAsSint16LE(_field2DE2); + s.syncAsSint16LE(_field2DE4); + s.syncAsSint16LE(_destPos.x); + s.syncAsSint16LE(_destPos.y); +} + void Scene910::postInit(SceneObjectList *OwnerList) { uint32 unk_50E94 = 0, unk_50E90 = 0; uint32 unk_50E98 = 0, unk_50E9C = 0; @@ -2573,10 +2581,10 @@ void Scene910::signal() { default: BF_GLOBALS._player.enableControl(); PlayerMover *mover = new PlayerMover(); - Common::Point destPos(_field2DDC, _field2DDE); - BF_GLOBALS._player.addMover(mover, &destPos, NULL); + BF_GLOBALS._player.addMover(mover, &_destPos, NULL); break; } + break; case 9124: BF_GLOBALS._player.enableControl(); BF_GLOBALS.setFlag(gunDrawn); @@ -2736,8 +2744,7 @@ void Scene910::process(Event &event) { break; if (BF_GLOBALS.getFlag(gunDrawn)) { BF_GLOBALS._player.disableControl(); - _field2DDC = BF_GLOBALS._player._position.x; - _field2DDE = BF_GLOBALS._player._position.y; + _destPos = BF_GLOBALS._player._position; _sceneMode = 9123; setAction(&_sequenceManager1, this, 9123, &BF_GLOBALS._player, NULL); event.handled = true; @@ -2765,8 +2772,7 @@ void Scene910::process(Event &event) { BF_GLOBALS._player.disableControl(); if (BF_GLOBALS._player._visage == 1911) { BF_GLOBALS._player.disableControl(); - _field2DDC = event.mousePos.x; - _field2DDE = event.mousePos.y; + _destPos = event.mousePos; _field2DDA = 0; _sceneMode = 9123; setAction(&_sequenceManager1, this, 9123, &BF_GLOBALS._player, NULL); @@ -2777,8 +2783,7 @@ void Scene910::process(Event &event) { } } else if (BF_GLOBALS._player._visage == 1911) { BF_GLOBALS._player.disableControl(); - _field2DDC = event.mousePos.x; - _field2DDE = event.mousePos.y; + _destPos = event.mousePos; _field2DDA = 0; _sceneMode = 9123; setAction(&_sequenceManager1, this, 9123, &BF_GLOBALS._player, NULL); diff --git a/engines/tsage/blue_force/blueforce_scenes9.h b/engines/tsage/blue_force/blueforce_scenes9.h index dc983adeb1..42fd8cd3cf 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.h +++ b/engines/tsage/blue_force/blueforce_scenes9.h @@ -219,7 +219,7 @@ class Scene910: public PalettedScene { }; /* Items */ - class Item1: public NamedHotspot { + class Generator: public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -248,7 +248,8 @@ class Scene910: public PalettedScene { virtual bool startAction(CursorType action, Event &event); }; - int _field2DDA, _field2DDC, _field2DDE, _field2DD8, _field2DE0, _field2DE2, _field2DE4; + int _field2DDA, _field2DD8, _field2DE0, _field2DE2, _field2DE4; + Common::Point _destPos; public: SequenceManager _sequenceManager1, _sequenceManager2; SpeakerGameText _gameTextSpeaker; @@ -271,7 +272,7 @@ public: BreakerBoxInset _breakerBoxInset; GeneratorInset _generatorInset; NamedObject _object30, _object31, _object32; - Item1 _generator; + Generator _generator; Item2 _item2; Item3 _item3; NamedHotspot _item4, _item5, _item6, _item7, _item8; @@ -283,6 +284,7 @@ public: ASoundExt _sound1, _sound2; virtual void postInit(SceneObjectList *OwnerList = NULL); + void synchronize(Serializer &s); virtual void remove(); virtual void signal(); virtual void process(Event &event); |