aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-01-06 00:19:28 +0100
committerStrangerke2012-01-06 00:19:28 +0100
commitf5c54bd9a36a106b05df0234c342d319f9307410 (patch)
tree3c1ba054b7543abb0167e277d6e8da5e7f692209
parent8e54ddfabf81d382c4e6f026611a7dabd90c9a51 (diff)
downloadscummvm-rg350-f5c54bd9a36a106b05df0234c342d319f9307410.tar.gz
scummvm-rg350-f5c54bd9a36a106b05df0234c342d319f9307410.tar.bz2
scummvm-rg350-f5c54bd9a36a106b05df0234c342d319f9307410.zip
TSAGE: R2R - Implement scene 1020
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp2
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.cpp126
-rw-r--r--engines/tsage/ringworld2/ringworld2_scenes1.h9
3 files changed, 136 insertions, 1 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index d906debf82..aa9e1dfe1e 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -94,8 +94,10 @@ Scene *Ringworld2Game::createScene(int sceneNumber) {
case 1000:
error("Missing scene %d from group 1", sceneNumber);
case 1010:
+ // Cutscene - trip in space
return new Scene1010();
case 1020:
+ return new Scene1020();
case 1100:
case 1200:
case 1330:
diff --git a/engines/tsage/ringworld2/ringworld2_scenes1.cpp b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
index e514155435..1949d19d80 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.cpp
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.cpp
@@ -30,7 +30,7 @@ namespace TsAGE {
namespace Ringworld2 {
/*--------------------------------------------------------------------------
- * Scene 1010 -
+ * Scene 1010 - Cutscene: A pixel lost in space!
*
*--------------------------------------------------------------------------*/
void Scene1010::postInit(SceneObjectList *OwnerList) {
@@ -88,5 +88,129 @@ void Scene1010::signal() {
}
}
+/*--------------------------------------------------------------------------
+ * Scene 1020 -
+ *
+ *--------------------------------------------------------------------------*/
+void Scene1020::postInit(SceneObjectList *OwnerList) {
+ SceneExt::postInit();
+ loadScene(1020);
+
+ if (R2_GLOBALS._sceneManager._previousScene == 1010)
+ g_globals->gfxManager()._bounds.moveTo(Common::Point(160, 0));
+
+ R2_GLOBALS._v558B6.set(160, 0, 160, 161);
+ R2_GLOBALS._v58CE2 = 0;
+ R2_GLOBALS._player.postInit();
+
+ if (R2_GLOBALS._sceneManager._previousScene == 1010) {
+ R2_GLOBALS._player.setPosition(Common::Point(500, 100));
+ R2_GLOBALS._player.setup(1020, 1, 1);
+ } else {
+ R2_GLOBALS._player.setPosition(Common::Point(0, 100));
+ R2_GLOBALS._player.setup(1020, 2, 1);
+ }
+
+ R2_GLOBALS._player.setObjectWrapper(NULL);
+ R2_GLOBALS._player.hide();
+ R2_GLOBALS._player.disableControl();
+ setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL);
+
+ if (R2_GLOBALS._sceneManager._previousScene == 1010)
+ _sceneMode = 0;
+ else
+ _sceneMode = 10;
+}
+
+void Scene1020::signal() {
+ switch (_sceneMode) {
+ case 0: {
+ _sceneMode = 1;
+ R2_GLOBALS._player.show();
+ R2_GLOBALS._player.setPosition(Common::Point(347, 48));
+ R2_GLOBALS._player._moveDiff = Common::Point(2, 1);
+ R2_GLOBALS._player.setZoom(0);
+ Common::Point pt(392, 41);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, this);
+ }
+ break;
+ case 1:
+ _sceneMode = 2;
+ R2_GLOBALS._player.setZoom(100);
+ R2_GLOBALS._player.animate(ANIM_MODE_5, this);
+ break;
+ case 2: {
+ _sceneMode = 3;
+ R2_GLOBALS._player._moveDiff = Common::Point(30, 15);
+ Common::Point pt(-15, 149);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, this);
+ }
+ break;
+ case 3:
+ _sceneMode = 4;
+ setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL);
+ break;
+ case 4:
+ R2_GLOBALS.setFlag(51);
+ R2_GLOBALS._sceneManager.changeScene(300);
+ break;
+ case 10: {
+ _sceneMode = 11;
+ R2_GLOBALS._player.setPosition(Common::Point(25, 133));
+ R2_GLOBALS._player._moveDiff = Common::Point(30, 15);
+ R2_GLOBALS._player.setZoom(100);
+ Common::Point pt(355, 60);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, this);
+ }
+ break;
+ case 11:
+ R2_GLOBALS._player.setPosition(Common::Point(355, 57));
+ _sceneMode = 12;
+ R2_GLOBALS._player.animate(ANIM_MODE_5, this);
+ break;
+ case 12: {
+ R2_GLOBALS._player.setPosition(Common::Point(355, 60));
+ _sceneMode = 13;
+ R2_GLOBALS._player._moveDiff = Common::Point(3, 1);
+ Common::Point pt(347, 48);
+ NpcMover *mover = new NpcMover();
+ R2_GLOBALS._player.addMover(mover, &pt, this);
+ }
+ break;
+ case 13:
+ setAction(&_sequenceManager, this, 1, &R2_GLOBALS._player, NULL);
+ if (R2_GLOBALS._player._percent < 1)
+ _sceneMode = 14;
+ break;
+ case 14:
+ R2_GLOBALS._sceneManager.changeScene(1010);
+ break;
+ default:
+ break;
+ }
+}
+
+void Scene1020::dispatch() {
+ if (_sceneMode == 1) {
+ R2_GLOBALS._player.setZoom(R2_GLOBALS._player._percent + 1);
+ if (R2_GLOBALS._player._percent > 10)
+ R2_GLOBALS._player._moveDiff.x = 3;
+ if (R2_GLOBALS._player._percent > 20)
+ R2_GLOBALS._player._moveDiff.x = 4;
+ }
+
+ if ((_sceneMode == 13) && (R2_GLOBALS._player._percent != 0)) {
+ R2_GLOBALS._player.setZoom(R2_GLOBALS._player._percent - 2);
+ if (R2_GLOBALS._player._percent < 80)
+ R2_GLOBALS._player._moveDiff.x = 2;
+ if (R2_GLOBALS._player._percent < 70)
+ R2_GLOBALS._player._moveDiff.x = 1;
+ }
+
+ Scene::dispatch();
+}
} // 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 4ddd064325..f0444de70d 100644
--- a/engines/tsage/ringworld2/ringworld2_scenes1.h
+++ b/engines/tsage/ringworld2/ringworld2_scenes1.h
@@ -47,6 +47,15 @@ public:
virtual void signal();
};
+class Scene1020 : public SceneExt {
+public:
+ SequenceManager _sequenceManager;
+
+ virtual void postInit(SceneObjectList *OwnerList = NULL);
+ virtual void signal();
+ virtual void dispatch();
+};
+
} // End of namespace Ringworld2
} // End of namespace TsAGE