diff options
author | Strangerke | 2012-01-05 15:19:55 +0100 |
---|---|---|
committer | Strangerke | 2012-01-05 15:20:42 +0100 |
commit | e914ec5d890dc742f40b19b127d2e9e44d418cd9 (patch) | |
tree | ae96bffa9c3af8bec088464da10d5d546fd7e6fe | |
parent | c2c8108f3bda8b7f4b4ba930e77b62ef6ffdd0ae (diff) | |
download | scummvm-rg350-e914ec5d890dc742f40b19b127d2e9e44d418cd9.tar.gz scummvm-rg350-e914ec5d890dc742f40b19b127d2e9e44d418cd9.tar.bz2 scummvm-rg350-e914ec5d890dc742f40b19b127d2e9e44d418cd9.zip |
TSAGE: R2R - Implement scene 3900
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.cpp | 263 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes3.h | 41 |
3 files changed, 304 insertions, 2 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 1f046d1bff..d39db9c2f8 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -234,7 +234,7 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 3800: return new Scene3800(); case 3900: - error("Missing scene %d from group 3", sceneNumber); + return new Scene3900(); default: error("Unknown scene number - %d", sceneNumber); break; diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.cpp b/engines/tsage/ringworld2/ringworld2_scenes3.cpp index a8deb88829..5ae15d9c08 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes3.cpp @@ -3968,7 +3968,7 @@ void Scene3800::postInit(SceneObjectList *OwnerList) { SceneExt::postInit(); R2_GLOBALS._sound1.play(231); - warning("sub_1B007(65, 65, 65)"); + warning("sub1B007(65, 65, 65)"); setZoomPercents(87, 40, 144, 100); @@ -4074,5 +4074,266 @@ void Scene3800::process(Event &event) { Scene::process(event); } +/*-------------------------------------------------------------------------- + * Scene 3900 - + * + *--------------------------------------------------------------------------*/ +void Scene3900::Exit1::changeScene() { + Scene3900 *scene = (Scene3900 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._v566A9 = 3; + R2_GLOBALS._v566AA = 1; + R2_GLOBALS._v566A8 = 1; + scene->_sceneMode = 14; + + Common::Point pt(160, 115); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene3900::Exit2::changeScene() { + Scene3900 *scene = (Scene3900 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._v566A9 = 4; + R2_GLOBALS._v566AA = 2; + R2_GLOBALS._v566A8 = 1; + scene->_sceneMode = 14; + + Common::Point pt(330, 145); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene3900::Exit3::changeScene() { + Scene3900 *scene = (Scene3900 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._v566A9 = 1; + R2_GLOBALS._v566AA = 3; + R2_GLOBALS._v566A8 = 1; + scene->_sceneMode = 14; + + Common::Point pt(160, 220); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene3900::Exit4::changeScene() { + Scene3900 *scene = (Scene3900 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(CURSOR_ARROW); + R2_GLOBALS._v566A9 = 2; + R2_GLOBALS._v566AA = 4; + R2_GLOBALS._v566A8 = 1; + scene->_sceneMode = 14; + + Common::Point pt(-10, 145); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); +} + +void Scene3900::Exit5::changeScene() { + Scene3900 *scene = (Scene3900 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(CURSOR_ARROW); + scene->_sceneMode = 13; + + if (R2_GLOBALS._v566A9 == 4) { + Common::Point pt(-10, 135); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); + } else { + Common::Point pt(330, 135); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, scene); + } + + R2_GLOBALS._v566A9 = 0; +} + +void Scene3900::postInit(SceneObjectList *OwnerList) { + if ((R2_GLOBALS._v566AA == 2) && (R2_GLOBALS._sceneManager._previousScene != 2700)) + loadScene(3825); + else + loadScene(3820); + SceneExt::postInit(); + R2_GLOBALS._sound1.changeSound(231); + setZoomPercents(87, 40, 144, 100); + R2_GLOBALS._player.disableControl(); + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.setVisage(10); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.setStrip(3); + R2_GLOBALS._player.changeZoom(-1); + R2_GLOBALS._player._moveDiff = Common::Point(3, 2); + _actor1.postInit(); + _actor1.fixPriority(10); + _actor1.changeZoom(-1); + _actor1.setVisage(1110); + _actor1._effect = 5; + _actor1._field9C = _field312; + R2_GLOBALS._player._linkedActor = &_actor1; + if ((R2_GLOBALS._v566AA == 2) && (R2_GLOBALS._sceneManager._previousScene != 2700)) { +// loadScene(3825); + R2_GLOBALS._v566AA = 4; + _exit1.setDetails(Rect(29, 87, 305, 125), SHADECURSOR_UP, 3900); + _exit3.setDetails(Rect(29, 160, 305, 168), SHADECURSOR_DOWN, 3900); + + _exit2.setDetails(Rect(305, 87, 320, 168), EXITCURSOR_E, 3900); + _exit2.setDest(Common::Point(312, 145)); + _exit2._enabled = true; + _exit2._insideArea = false; + _exit2._moving = false; + + _exit4._enabled = false; + + _exit5.setDetails(Rect(0, 87, 29, 168), EXITCURSOR_W, 3900); + _exit5.setDest(Common::Point(24, 135)); + } else { +// loadScene(3820); + R2_GLOBALS._v566AA = 2; + _exit1.setDetails(Rect(14, 87, 290, 125), SHADECURSOR_UP, 3900); + _exit3.setDetails(Rect(14, 160, 290, 168), SHADECURSOR_DOWN, 3900); + + + _exit2._enabled = false; + + _exit4.setDetails(Rect(0, 87, 14, 168), EXITCURSOR_W, 3900); + _exit4.setDest(Common::Point(7, 145)); + _exit4._enabled = true; + _exit4._insideArea = false; + _exit4._moving = false; + + _exit5.setDetails(Rect(290, 87, 320, 168), EXITCURSOR_E, 3900); + _exit5.setDest(Common::Point(295, 135)); + } + _exit5._enabled = true; + _exit5._insideArea = false; + _exit5._moving = false; + + warning("sub1B007(65, 65, 65)"); + _exit1.setDest(Common::Point(160, 126)); + _exit1._enabled = true; + _exit1._insideArea = false; + _exit1._moving = false; + + _exit3.setDest(Common::Point(160, 165)); + _exit3._enabled = true; + _exit3._insideArea = false; + _exit3._moving = false; + + R2_GLOBALS._uiElements.draw(); + + _rect1.set(0, 0, 320, 87); + _item1.setDetails(Rect(0, 0, 320, 200), 3800, 0, 1, 2, 1, (SceneItem *)NULL); + if (R2_GLOBALS._sceneManager._previousScene == 3800) { + _sceneMode = 11; + switch (R2_GLOBALS._v566AA - 1) { + case 0: { + R2_GLOBALS._player.setPosition(Common::Point(160, 115)); + Common::Point pt(160, 120); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } + break; + case 1: { + R2_GLOBALS._player.setPosition(Common::Point(330, 145)); + Common::Point pt(300, 145); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } + break; + case 2: { + R2_GLOBALS._player.setPosition(Common::Point(160, 220)); + Common::Point pt(160, 160); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } + break; + case 3: { + R2_GLOBALS._player.setPosition(Common::Point(-10, 145)); + Common::Point pt(19, 145); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } + break; + default: + break; + } + } else if (R2_GLOBALS._sceneManager._previousScene == 2700) { + _sceneMode = 12; + R2_GLOBALS._player.setPosition(Common::Point(330, 135)); + Common::Point pt(265, 135); + NpcMover *mover = new NpcMover(); + R2_GLOBALS._player.addMover(mover, &pt, this); + } else { + R2_GLOBALS._player.setPosition(Common::Point(160, 145)); + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + } +} + +void Scene3900::signal() { + switch (_sceneMode) { + case 11: + // No break on purpose + case 12: + R2_GLOBALS._v56AAB = 0; + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + break; + case 13: + R2_GLOBALS._sceneManager.changeScene(2700); + break; + case 14: + R2_GLOBALS._sceneManager.changeScene(3800); + break; + case 3805: + _exit1._enabled = false; + _exit2._enabled = false; + _exit3._enabled = false; + _exit4._enabled = false; + R2_GLOBALS._player._canWalk = false; + R2_GLOBALS._events.setCursor(R2_STEPPING_DISKS); + break; + case 3806: + _exit1._enabled = true; + _exit2._enabled = true; + _exit3._enabled = true; + _exit4._enabled = true; + R2_GLOBALS._player.enableControl(CURSOR_ARROW); + break; + default: + break; + } +} + +void Scene3900::process(Event &event) { + if ((R2_GLOBALS._player._uiEnabled) && (event.eventType == 1) && (_rect1.contains(event.mousePos))) { + event.handled = true; + switch (R2_GLOBALS._events.getCursor()) { + case R2_NEGATOR_GUN: + R2_GLOBALS._player.addMover(NULL); + R2_GLOBALS._player.updateAngle(event.mousePos); + break; + case R2_STEPPING_DISKS: + SceneItem::display(3800, 5, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + break; + case R2_ATTRACTOR_UNIT: + SceneItem::display(3800, 3, 0, 280, 1, 160, 9, 1, 2, 20, 7, 7, -999); + break; + default: + event.handled = false; + break; + } + } + Scene::process(event); +} + } // End of namespace Ringworld2 } // End of namespace TsAGE diff --git a/engines/tsage/ringworld2/ringworld2_scenes3.h b/engines/tsage/ringworld2/ringworld2_scenes3.h index d5536791b1..c925871747 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes3.h +++ b/engines/tsage/ringworld2/ringworld2_scenes3.h @@ -702,6 +702,47 @@ public: virtual void process(Event &event); virtual void synchronize(Serializer &s); }; + +class Scene3900 : public SceneExt { + class Exit1 : public SceneExit { + public: + virtual void changeScene(); + }; + + class Exit2 : public SceneExit { + public: + virtual void changeScene(); + }; + + class Exit3 : public SceneExit { + public: + virtual void changeScene(); + }; + + class Exit4 : public SceneExit { + public: + virtual void changeScene(); + }; + + class Exit5 : public SceneExit { + public: + virtual void changeScene(); + }; +public: + SceneActor _actor1; + NamedHotspot _item1; + Exit1 _exit1; + Exit2 _exit2; + Exit3 _exit3; + Exit4 _exit4; + Exit5 _exit5; + Rect _rect1; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); + virtual void process(Event &event); +}; + } // End of namespace Ringworld2 } // End of namespace TsAGE |