From ec7e7519112247470e3e539a43040022a6e12c6e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 19 Mar 2011 21:07:04 +1100 Subject: TSAGE: Implemented Scene 2400 - Descending in Lander --- engines/tsage/core.cpp | 4 +++ engines/tsage/core.h | 1 + engines/tsage/ringworld_logic.cpp | 2 ++ engines/tsage/ringworld_scenes3.cpp | 59 +++++++++++++++++++++++++++++++++++++ engines/tsage/ringworld_scenes3.h | 14 +++++++++ engines/tsage/scenes.cpp | 2 +- 6 files changed, 81 insertions(+), 1 deletion(-) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 503dd54103..f06e7f532b 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -1682,6 +1682,10 @@ void SceneObject::setZoom(int percent) { } } +void SceneObject::updateZoom() { + changeZoom(_percent); +} + void SceneObject::changeZoom(int percent) { if (percent == -1) _flags &= ~OBJFLAG_ZOOMED; diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 79731bf46a..d961f8bdd1 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -507,6 +507,7 @@ public: void setStrip(int frameNum); void setStrip2(int frameNum); void setZoom(int percent); + void updateZoom(); void changeZoom(int percent); void setFrame(int frameNum); void setFrame2(int frameNum); diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index 5b86929772..2e451493ec 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -94,6 +94,8 @@ Scene *SceneFactory::createScene(int sceneNumber) { case 2310: return new Scene2310(); // Starcraft - Lander Bay case 2320: return new Scene2320(); + // Scene 2400 - Descending in Lander + case 2400: return new Scene2400(); /* Scene group 4 */ diff --git a/engines/tsage/ringworld_scenes3.cpp b/engines/tsage/ringworld_scenes3.cpp index 6c793c83b4..a12a7c41f0 100644 --- a/engines/tsage/ringworld_scenes3.cpp +++ b/engines/tsage/ringworld_scenes3.cpp @@ -6034,6 +6034,65 @@ void Scene2320::signal() { } } +/*-------------------------------------------------------------------------- + * Scene 2400 - Descending in Lander + * + *--------------------------------------------------------------------------*/ + +void Scene2400::Action1::signal() { + switch (_actionIndex++) { + case 0: + setDelay(60); + break; + case 1: + ADD_MOVER(_globals->_player, 160, 71); + break; + case 2: + ADD_MOVER(_globals->_player, 160, 360); + break; + case 3: + _globals->_player._moveDiff = Common::Point(1, 1); + ADD_MOVER(_globals->_player, 140, 375); + break; + case 4: + ADD_MOVER(_globals->_player, 87, 338); + break; + case 5: + _globals->_player.flag100(); + setDelay(60); + break; + case 6: + _globals->_sceneManager.changeScene(4000); + break; + } +} +void Scene2400::Action1::dispatch() { + Action::dispatch(); + if ((_actionIndex == 4) && (_globals->_player._percent > 5)) + _globals->_player.changeZoom(_globals->_player._percent - 2); +} + +/*--------------------------------------------------------------------------*/ + +void Scene2400::postInit(SceneObjectList *OwnerList) { + loadScene(2400); + Scene::postInit(); + setZoomPercents(0, 100, 200, 100); + + _globals->_player.postInit(); + _globals->_player.setVisage(2410); + _globals->_player.setPosition(Common::Point(340, -10)); + _globals->_player.animate(ANIM_MODE_2, NULL); + _globals->_player.disableControl(); + + setAction(&_action1); + + _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position.x, _globals->_player._position.y); + _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); + _globals->_sceneOffset.x = (_globals->_sceneManager._scene->_sceneBounds.left / 160) * 160; + + _globals->_soundHandler.startSound(153); +} } // End of namespace tSage diff --git a/engines/tsage/ringworld_scenes3.h b/engines/tsage/ringworld_scenes3.h index 24b3ee3f22..420307ca99 100644 --- a/engines/tsage/ringworld_scenes3.h +++ b/engines/tsage/ringworld_scenes3.h @@ -886,6 +886,20 @@ public: virtual void signal(); }; +class Scene2400: public Scene { + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + virtual void dispatch(); + }; +public: + Action1 _action1; + SceneObject _object; + + virtual void postInit(SceneObjectList *OwnerList = NULL); +}; + } // End of namespace tSage #endif diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index a1dfe0b2ce..40f29e661a 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -164,7 +164,7 @@ void SceneManager::setBackSurface() { if (size > 96000) { if (_globals->_sceneManager._scene->_backgroundBounds.width() <= SCREEN_WIDTH) { // Standard size creation - _globals->_sceneManager._scene->_backSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT); + _globals->_sceneManager._scene->_backSurface.create(SCREEN_WIDTH, SCREEN_HEIGHT * 3 / 2); _globals->_sceneManager._scrollerRect = Rect(0, 30, SCREEN_WIDTH, SCREEN_HEIGHT - 30); } else { // Wide screen needs extra space to allow for scrolling -- cgit v1.2.3