diff options
author | Paul Gilbert | 2011-11-23 17:56:20 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-11-23 17:56:20 +1100 |
commit | d92650294fce75da6f2d8840250d3084540700db (patch) | |
tree | ba8fdc2d7504b70ab04b8d0ca3412c96e399de79 | |
parent | afc92983bea4c060917a2388e89d405df388d522 (diff) | |
download | scummvm-rg350-d92650294fce75da6f2d8840250d3084540700db.tar.gz scummvm-rg350-d92650294fce75da6f2d8840250d3084540700db.tar.bz2 scummvm-rg350-d92650294fce75da6f2d8840250d3084540700db.zip |
TSAGE: Implemented R2RW Scene 325 - Ship Corridor
-rw-r--r-- | engines/tsage/events.h | 3 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_logic.cpp | 3 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes0.cpp | 154 | ||||
-rw-r--r-- | engines/tsage/ringworld2/ringworld2_scenes0.h | 37 |
4 files changed, 197 insertions, 0 deletions
diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 2ffa862ca6..541da00147 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -92,6 +92,9 @@ enum CursorType { R2_43 = 43, R2_44 = 44, R2_45 = 45, R2_46 = 46, R2_47 = 47, R2_48 = 48, R2_49 = 49, R2_50 = 50, R2_51 = 51, R2_52 = 52, + // Ringworld 2 cursors + CURSOR_3 = 3, CURSOR_9 = 9, CURSOR_10 = 10, + // Cursors CURSOR_WALK = 0x100, CURSOR_LOOK = 0x200, CURSOR_700 = 700, CURSOR_USE = 0x400, CURSOR_TALK = 0x800, CURSOR_1000 = 0x1000, CURSOR_PRINTER = 0x4000, CURSOR_EXIT = 0x7004, CURSOR_9999 = 9999, diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp index 2946c9464f..942d1e451f 100644 --- a/engines/tsage/ringworld2/ringworld2_logic.cpp +++ b/engines/tsage/ringworld2/ringworld2_logic.cpp @@ -46,7 +46,10 @@ Scene *Ringworld2Game::createScene(int sceneNumber) { case 160: case 175: case 180: + error("Missing scene %d from group 0", sceneNumber); case 200: + // Ship Corridor + return new Scene200(); case 205: case 250: error("Missing scene %d from group 0", sceneNumber); diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.cpp b/engines/tsage/ringworld2/ringworld2_scenes0.cpp index 4df081d0cb..5db5ee011c 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.cpp +++ b/engines/tsage/ringworld2/ringworld2_scenes0.cpp @@ -1199,6 +1199,160 @@ Common::String Scene125::parseMessage(const Common::String &msg) { } /*-------------------------------------------------------------------------- + * Scene 200 - Ship Corridor + * + *--------------------------------------------------------------------------*/ + +bool Scene200::NorthDoor::startAction(CursorType action, Event &event) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 202; + scene->setAction(&scene->_sequenceManager, scene, 202, &R2_GLOBALS._player, this, NULL); + return true; + } else { + return SceneActor::startAction(action, event); + } +} + +bool Scene200::EastDoor::startAction(CursorType action, Event &event) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 200; + scene->setAction(&scene->_sequenceManager, scene, 200, &R2_GLOBALS._player, this, NULL); + return true; + } else { + return SceneActor::startAction(action, event); + } +} + +bool Scene200::WestDoor::startAction(CursorType action, Event &event) { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + + if (action == CURSOR_USE) { + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 204; + scene->setAction(&scene->_sequenceManager, scene, 204, &R2_GLOBALS._player, this, NULL); + return true; + } else { + return SceneActor::startAction(action, event); + } +} + +/*--------------------------------------------------------------------------*/ + +void Scene200::EastExit::changeScene() { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 206; + scene->setAction(&scene->_sequenceManager, scene, 206, &R2_GLOBALS._player, NULL); +} + +void Scene200::WestExit::changeScene() { + Scene200 *scene = (Scene200 *)R2_GLOBALS._sceneManager._scene; + + _enabled = false; + R2_GLOBALS._player.disableControl(); + scene->_sceneMode = 208; + scene->setAction(&scene->_sequenceManager, scene, 208, &R2_GLOBALS._player, NULL); +} + +/*--------------------------------------------------------------------------*/ + +void Scene200::postInit(SceneObjectList *OwnerList) { + SceneExt::postInit(); + loadScene(200); + + _westExit.setDetails(Rect(94, 0, 123, 58), CURSOR_9, 175); + _westExit.setDest(Common::Point(125, 52)); + _eastExit.setDetails(Rect(133, 0, 167, 58), CURSOR_10, 150); + _eastExit.setDest(Common::Point(135, 52)); + + _northDoor.postInit(); + _northDoor.setVisage(200); + _northDoor.setPosition(Common::Point(188, 79)); + _northDoor.setDetails(200, 3, -1, -1, 1, NULL); + + _eastDoor.postInit(); + _eastDoor.setVisage(200); + _eastDoor.setStrip(2); + _eastDoor.setPosition(Common::Point(305, 124)); + _eastDoor.setDetails(200, 6, -1, -1, 1, NULL); + + _westDoor.postInit(); + _westDoor.setVisage(200); + _westDoor.setStrip(3); + _westDoor.setPosition(Common::Point(62, 84)); + _westDoor.setDetails(200, 9, -1, -1, 1, NULL); + + R2_GLOBALS._player.postInit(); + R2_GLOBALS._player.setVisage(10); + R2_GLOBALS._player.animate(ANIM_MODE_1, NULL); + R2_GLOBALS._player.disableControl(); + + _compartment.setDetails(Rect(4, 88, 153, 167), 200, 12, -1, -1, 1, NULL); + _westDoorDisplay.setDetails(Rect(41, 51, 48, 61), 200, 15, -1, -1, 1, NULL); + _eastDoorDisplay.setDetails(Rect(279, 67, 286, 78), 200, 18, -1, -1, 1, NULL); + _background.setDetails(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 200, 0, -1, -1, 1, NULL); + + switch (R2_GLOBALS._sceneManager._previousScene) { + case 100: + _sceneMode = 201; + setAction(&_sequenceManager, this, 201, &R2_GLOBALS._player, &_eastDoor, NULL); + break; + case 150: + _sceneMode = 207; + setAction(&_sequenceManager, this, 207, &R2_GLOBALS._player, NULL); + break; + case 175: + _sceneMode = 209; + setAction(&_sequenceManager, this, 209, &R2_GLOBALS._player, NULL); + break; + case 250: + _sceneMode = 203; + setAction(&_sequenceManager, this, 203, &R2_GLOBALS._player, &_northDoor, NULL); + break; + case 400: + _sceneMode = 205; + setAction(&_sequenceManager, this, 205, &R2_GLOBALS._player, &_westDoor, NULL); + break; + default: + R2_GLOBALS._player.setStrip(3); + R2_GLOBALS._player.setPosition(Common::Point(215, 115)); + R2_GLOBALS._player.enableControl(); + break; + } +} + +void Scene200::signal() { + switch (_sceneMode) { + case 200: + R2_GLOBALS._sceneManager.changeScene(100); + break; + case 202: + R2_GLOBALS._sceneManager.changeScene(250); + break; + case 204: + R2_GLOBALS._sceneManager.changeScene(400); + break; + case 206: + R2_GLOBALS._sceneManager.changeScene(150); + break; + case 208: + R2_GLOBALS._sceneManager.changeScene(175); + break; + default: + R2_GLOBALS._player.enableControl(); + break; + } +} + +/*-------------------------------------------------------------------------- * Scene 300 - Bridge * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld2/ringworld2_scenes0.h b/engines/tsage/ringworld2/ringworld2_scenes0.h index c207118372..4d2c454c4e 100644 --- a/engines/tsage/ringworld2/ringworld2_scenes0.h +++ b/engines/tsage/ringworld2/ringworld2_scenes0.h @@ -157,6 +157,43 @@ public: Common::String parseMessage(const Common::String &msg); }; +class Scene200: public SceneExt { + /* Objects */ + class NorthDoor: public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class EastDoor: public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + class WestDoor: public SceneActor { + public: + virtual bool startAction(CursorType action, Event &event); + }; + + /* Scene Exits */ + class EastExit: public SceneExit { + public: + virtual void changeScene(); + }; + class WestExit: public SceneExit { + public: + virtual void changeScene(); + }; +public: + NamedHotspot _background, _compartment, _westDoorDisplay, _eastDoorDisplay; + NorthDoor _northDoor; + EastDoor _eastDoor; + WestDoor _westDoor; + EastExit _eastExit; + WestExit _westExit; + SequenceManager _sequenceManager; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + virtual void signal(); +}; + class Scene300: public SceneExt { /* Actions */ class Action1: public Action { |