aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage
diff options
context:
space:
mode:
authorStrangerke2012-01-20 19:45:24 +0100
committerStrangerke2012-01-20 19:45:24 +0100
commit0f6750945651b6213fd47a7a84e3afc8e65b2afd (patch)
tree0ac1944ebb55d636638e7e01f0b8c7039e4d90ff /engines/tsage
parent69a2c72c47558dfd54762d2361b0fc2c5e680317 (diff)
downloadscummvm-rg350-0f6750945651b6213fd47a7a84e3afc8e65b2afd.tar.gz
scummvm-rg350-0f6750945651b6213fd47a7a84e3afc8e65b2afd.tar.bz2
scummvm-rg350-0f6750945651b6213fd47a7a84e3afc8e65b2afd.zip
TSAGE: R2R - Implement scene 1875
Diffstat (limited to 'engines/tsage')
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp208
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h33
3 files changed, 243 insertions, 0 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index ff694a69fd..7e4cbd88ad 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -133,7 +133,9 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
case 1800:
return new Scene1800();
case 1850:
+ error("Missing scene %d from group 1", sceneNumber);
case 1875:
+ return new Scene1875();
case 1900:
case 1925:
case 1945:
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index 2fa7f50cb4..18d27b3c49 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -6164,5 +6164,213 @@ void Scene1800::saveCharacter(int characterIndex) {
SceneExt::saveCharacter(characterIndex);
}
+/*--------------------------------------------------------------------------
+ * Scene 1875 -
+ *
+ *--------------------------------------------------------------------------*/
+Scene1875::Actor1875::Actor1875() {
+ _fieldA4 = 0;
+ _fieldA6 = 0;
+}
+
+void Scene1875::Actor1875::synchronize(Serializer &s) {
+ SceneActor::synchronize(s);
+
+ s.syncAsSint16LE(_fieldA4);
+ s.syncAsSint16LE(_fieldA6);
+}
+
+void Scene1875::Actor1875::subB84AB() {
+ Scene1875 *scene = (Scene1875 *)R2_GLOBALS._sceneManager._scene;
+
+ R2_GLOBALS._sound1.play(227);
+
+ int newFrameNumber;
+ switch (_fieldA4) {
+ case 3:
+ if ((scene->_actor1._frame == 1) && (scene->_actor4._strip == 2)) {
+ R2_GLOBALS._player.disableControl();
+ R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
+ scene->_sceneMode = 10;
+ scene->_stripManager.start(576, this);
+ } else {
+ R2_GLOBALS._player.disableControl();
+ scene->_sceneMode = 1890;
+ scene->_actor2.postInit();
+ scene->setAction(&scene->_sequenceManager, scene, 1890, &scene->_actor2, NULL);
+ }
+ break;
+ case 4:
+ newFrameNumber = scene->_actor1._frame + 1;
+ if (newFrameNumber > 6)
+ newFrameNumber = 1;
+ scene->_actor1.setFrame(newFrameNumber);
+ break;
+ case 5:
+ newFrameNumber = scene->_actor1._frame - 1;
+ if (newFrameNumber < 1)
+ newFrameNumber = 6;
+ scene->_actor1.setFrame(newFrameNumber);
+ break;
+ default:
+ break;
+ }
+}
+
+void Scene1875::Actor1875::subB8271(int indx) {
+ postInit();
+ _fieldA4 = indx;
+ _fieldA6 = 0;
+ setVisage(1855);
+
+ if (_fieldA4 == 1)
+ setStrip(2);
+ else
+ setStrip(1);
+
+ setFrame(_fieldA4);
+ switch (_fieldA4 - 1) {
+ case 0:
+ setPosition(Common::Point(20, 144));
+ break;
+ case 1:
+ setPosition(Common::Point(82, 144));
+ break;
+ case 2:
+ setPosition(Common::Point(136, 144));
+ break;
+ case 3:
+ setPosition(Common::Point(237, 144));
+ break;
+ case 4:
+ setPosition(Common::Point(299, 144));
+ break;
+ default:
+ break;
+ }
+
+ setDetails(1875, 6, 1, -1, 2, (SceneItem *) NULL);
+}
+
+void Scene1875::Actor1875::process(Event &event) {
+ if ((R2_GLOBALS._player._uiEnabled) || (event.handled))
+ return;
+
+ Scene1875 *scene = (Scene1875 *)R2_GLOBALS._sceneManager._scene;
+
+ if ((event.eventType == EVENT_BUTTON_DOWN) && (R2_GLOBALS._events.getCursor() == R2_STEPPING_DISKS) && (_bounds.contains(event.mousePos)) && (_fieldA6 == 0)) {
+ setStrip(2);
+ switch (_fieldA4) {
+ case 1:
+ R2_GLOBALS._sound2.play(227);
+ scene->_actor5.setStrip(1);
+ break;
+ case 2:
+ R2_GLOBALS._sound2.play(227);
+ scene->_actor4.setStrip(1);
+ break;
+ default:
+ break;
+ }
+ _fieldA6 = 1;
+ event.handled = true;
+ }
+
+ if ((event.eventType == EVENT_BUTTON_UP) && (_fieldA6 != 0)) {
+ if ((_fieldA4 == 3) || (_fieldA4 == 4) || (_fieldA4 == 5)) {
+ setStrip(1);
+ subB84AB();
+ }
+ _fieldA6 = 0;
+ event.handled = true;
+ }
+}
+
+void Scene1875::postInit(SceneObjectList *OwnerList) {
+ loadScene(1875);
+ SceneExt::postInit();
+
+ R2_GLOBALS._player._characterScene[1] = 1875;
+ R2_GLOBALS._player._characterScene[2] = 1875;
+
+ _stripManager.addSpeaker(&_quinnSpeaker);
+ _stripManager.addSpeaker(&_seekerSpeaker);
+
+ _actor4.subB8271(1);
+ _actor5.subB8271(2);
+ _actor6.subB8271(3);
+ _actor7.subB8271(4);
+ _actor8.subB8271(5);
+
+ _actor1.postInit();
+ _actor1.setup(1855, 4, 1);
+ _actor1.setPosition(Common::Point(160, 116));
+
+ R2_GLOBALS._player.postInit();
+ if (R2_GLOBALS._sceneManager._previousScene == 1625) {
+ R2_GLOBALS._sound1.play(122);
+ R2_GLOBALS._player.disableControl();
+ _sceneMode = 11;
+ _actor2.postInit();
+ setAction(&_sequenceManager, this, 1892, &_actor2, NULL);
+ } else if (R2_GLOBALS._sceneManager._previousScene == 3150) {
+ R2_GLOBALS._sound1.play(116);
+ } else {
+ R2_GLOBALS._player.enableControl();
+ R2_GLOBALS._player._canWalk = false;
+ }
+
+ _item2.setDetails(Rect(43, 14, 275, 122), 1875, 9, 1, -1, 1, NULL);
+ _item1.setDetails(Rect(0, 0, 320, 200), 1875, 3, -1, -1, 1, NULL);
+
+ R2_GLOBALS._player._characterScene[1] = 1875;
+ R2_GLOBALS._player._characterScene[2] = 1875;
+ R2_GLOBALS._player._oldCharacterScene[1] = 1875;
+ R2_GLOBALS._player._oldCharacterScene[2] = 1875;
+}
+
+void Scene1875::signal() {
+ switch (_sceneMode) {
+ case 10:
+ R2_GLOBALS._player.disableControl();
+ _sceneMode = 1891;
+ _actor2.postInit();
+ setAction(&_sequenceManager, this, 1891, &_actor2, NULL);
+ break;
+ case 11:
+ R2_GLOBALS._events.setCursor(CURSOR_CROSSHAIRS);
+ _sceneMode = 1892;
+ _stripManager.start(577, this);
+ break;
+ case 1890:
+ _actor2.remove();
+ R2_GLOBALS._player.enableControl();
+ R2_GLOBALS._player._canWalk = false;
+ break;
+ case 1891:
+ R2_GLOBALS._player.disableControl();
+ R2_GLOBALS._sceneManager.changeScene(1625);
+ break;
+ case 1892:
+ R2_GLOBALS._player.disableControl();
+ R2_GLOBALS._sceneManager.changeScene(1900);
+ break;
+ default:
+ R2_GLOBALS._player.enableControl();
+ R2_GLOBALS._player._canWalk = false;
+ break;
+ }
+}
+
+void Scene1875::process(Event &event) {
+ Scene::process(event);
+
+ _actor4.process(event);
+ _actor5.process(event);
+ _actor6.process(event);
+ _actor7.process(event);
+ _actor8.process(event);
+}
+
} // End of namespace Ringworld2
} // End of namespace TsAGE
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.h b/engines/tsage/ringworld2/ringworld2_scenes1.h
index 08d35edf06..e6ea196cee 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -634,6 +634,39 @@ public:
virtual void saveCharacter(int characterIndex);
};
+class Scene1875 : public SceneExt {
+ class Actor1875 : public SceneActor {
+ public:
+ int _fieldA4;
+ int _fieldA6;
+
+ Actor1875();
+ void subB84AB();
+ void subB8271(int indx);
+
+ void synchronize(Serializer &s);
+ virtual void process(Event &event);
+ };
+public:
+ SpeakerQuinn _quinnSpeaker;
+ SpeakerSeeker _seekerSpeaker;
+ NamedHotspot _item1;
+ NamedHotspot _item2;
+ SceneActor _actor1;
+ SceneActor _actor2;
+ SceneActor _actor3;
+ Actor1875 _actor4;
+ Actor1875 _actor5;
+ Actor1875 _actor6;
+ Actor1875 _actor7;
+ Actor1875 _actor8;
+ SequenceManager _sequenceManager;
+
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void signal();
+ virtual void process(Event &event);
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE