aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tsage/ringworld_logic.cpp2
-rw-r--r--engines/tsage/ringworld_scenes4.cpp121
-rw-r--r--engines/tsage/ringworld_scenes4.h33
3 files changed, 156 insertions, 0 deletions
diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp
index 87231a9dfd..2eacb2a316 100644
--- a/engines/tsage/ringworld_logic.cpp
+++ b/engines/tsage/ringworld_logic.cpp
@@ -102,6 +102,8 @@ Scene *SceneFactory::createScene(int sceneNumber) {
/* Scene group 4 */
// Ringworld Scan
case 3500: return new Scene3500();
+ // Remote Viewer
+ case 3700: return new Scene3700();
/* Scene group 5 */
diff --git a/engines/tsage/ringworld_scenes4.cpp b/engines/tsage/ringworld_scenes4.cpp
index eadc86a32f..51840154eb 100644
--- a/engines/tsage/ringworld_scenes4.cpp
+++ b/engines/tsage/ringworld_scenes4.cpp
@@ -90,4 +90,125 @@ void Scene3500::postInit(SceneObjectList *OwnerList) {
setAction((_globals->_stripNum == 3600) ? (Action *)&_action2 : (Action *)&_action1);
}
+/*--------------------------------------------------------------------------
+ * Scene 3700 - Remote Viewer
+ *
+ *--------------------------------------------------------------------------*/
+
+Scene3700::Viewer::Viewer() {
+ _imgList[0] = surfaceFromRes(3705, 1, 1);
+ for (int idx = 1; idx <= 3; ++idx)
+ _imgList[idx] = surfaceFromRes(3705, 2, _globals->_randomSource.getRandomNumber(4) + 1);
+
+ _field88 = 1;
+ _percent = 120;
+ _field94 = 50;
+ _field96 = 75;
+ _field98 = 114;
+}
+
+void Scene3700::Viewer::reposition() {
+ _bounds = Rect(123, 40, 285, 123);
+}
+
+void Scene3700::Viewer::draw() {
+ for (int idx = 0; idx < 4; ++idx) {
+ Rect destRect = _imgList[idx].getBounds();
+ destRect.resize(_imgList[idx], (_position.x - _globals->_sceneOffset.x),
+ (_position.y - _globals->_sceneOffset.y - _yDiff), _percent);
+
+ destRect.translate(-_globals->_sceneManager._scene->_sceneBounds.left,
+ -_globals->_sceneManager._scene->_sceneBounds.top);
+
+ Region *priorityRegion = _globals->_sceneManager._scene->_priorities.find(1);
+ _globals->gfxManager().copyFrom(_imgList[idx], destRect, priorityRegion);
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene3700::Action1::signal() {
+ Scene3700 *scene = (Scene3700 *)_globals->_sceneManager._scene;
+
+ switch (_actionIndex++) {
+ case 0:
+ setDelay(10);
+ break;
+ case 1:
+ scene->_stripManager.start(2162, this);
+ break;
+ case 2:
+ scene->_viewer._field88 = 0;
+ setDelay(90);
+ break;
+ case 3:
+ scene->_soundHandler.startSound(196);
+ scene->_viewer.flag100();
+
+ scene->_hotspot1.postInit();
+ scene->_hotspot1.setVisage(3710);
+ scene->_hotspot1.setStrip(1);
+ scene->_hotspot1.setFrame(1);
+ scene->_hotspot1.setPosition(Common::Point(204, 120));
+
+ setDelay(90);
+ break;
+ case 4:
+ scene->_soundHandler.startSound(197);
+ scene->_hotspot1.flag100();
+
+ scene->_hotspot2.postInit();
+ scene->_hotspot2.setVisage(3710);
+ scene->_hotspot2.setStrip(2);
+ scene->_hotspot2.setFrame(1);
+ scene->_hotspot2.setPosition(Common::Point(204, 120));
+
+ setDelay(30);
+ break;
+ case 5:
+ scene->_soundHandler.startSound(198);
+ scene->_hotspot2.flag100();
+ scene->_hotspot1.unflag100();
+ setDelay(90);
+ break;
+ case 6:
+ scene->_stripManager.start(2166, this);
+ break;
+ case 7:
+ setDelay(60);
+ break;
+ case 8:
+ scene->_hotspot1.remove();
+ scene->_hotspot2.unflag100();
+ _globals->setFlag(59);
+ setDelay(30);
+ break;
+ case 9:
+ _globals->_sceneManager.changeScene(2100);
+ break;
+ }
+}
+
+/*--------------------------------------------------------------------------*/
+
+void Scene3700::postInit(tSage::SceneObjectList *OwnerList) {
+ Scene::postInit();
+ loadScene(3700);
+
+ _stripManager.addSpeaker(&_speakerSText);
+ _stripManager.addSpeaker(&_speakerMText);
+ _stripManager.addSpeaker(&_speakerMR);
+ _speakerSText.setTextPos(Common::Point(20, 15));
+ _speakerMText.setTextPos(Common::Point(20, 15));
+
+ _viewer.postInit();
+ _viewer.setVisage(3705);
+ _viewer.setStrip(1);
+ _viewer.setFrame(2);
+ _viewer.setPosition(Common::Point(195, 83));
+
+ setAction(&_action1);
+ _globals->_soundHandler.startSound(195);
+}
+
} // End of namespace tSage
diff --git a/engines/tsage/ringworld_scenes4.h b/engines/tsage/ringworld_scenes4.h
index 9795561216..10d2cfe7db 100644
--- a/engines/tsage/ringworld_scenes4.h
+++ b/engines/tsage/ringworld_scenes4.h
@@ -53,6 +53,39 @@ public:
virtual void postInit(SceneObjectList *OwnerList = NULL);
};
+class Scene3700: public Scene {
+ /* Custom classes */
+ class Viewer: public SceneObject {
+ public:
+ GfxSurface _imgList[4];
+ int _field88;
+ int _percent;
+ int _field94;
+ int _field96;
+ int _field98;
+
+ Viewer();
+ virtual void reposition();
+ virtual void draw();
+ };
+
+ /* Actions */
+ class Action1: public Action {
+ public:
+ virtual void signal();
+ };
+public:
+ Viewer _viewer;
+ Action _action1;
+ SceneObject _hotspot1, _hotspot2;
+ SpeakerSText _speakerSText;
+ SpeakerMText _speakerMText;
+ SpeakerMR _speakerMR;
+ SoundHandler _soundHandler;
+
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+};
+
} // End of namespace tSage
#endif