diff options
author | Paul Gilbert | 2011-02-27 22:52:35 +1100 |
---|---|---|
committer | Paul Gilbert | 2011-02-27 22:52:35 +1100 |
commit | 2a2a33a14cbb2cf4e48cd652f230668958271499 (patch) | |
tree | 47cdb06dc073d1eef46defb27c50e5ef443d7922 /engines/tsage | |
parent | b702cd0fdf2b7e39825be6bad9a548529af5d760 (diff) | |
download | scummvm-rg350-2a2a33a14cbb2cf4e48cd652f230668958271499.tar.gz scummvm-rg350-2a2a33a14cbb2cf4e48cd652f230668958271499.tar.bz2 scummvm-rg350-2a2a33a14cbb2cf4e48cd652f230668958271499.zip |
TSAGE: Initial implementation of Scene #1400 - Arriving at Ringworld
Diffstat (limited to 'engines/tsage')
-rw-r--r-- | engines/tsage/core.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/ringworld_logic.cpp | 2 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes1.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes2.cpp | 129 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes2.h | 15 | ||||
-rw-r--r-- | engines/tsage/scenes.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/scenes.h | 2 |
7 files changed, 154 insertions, 8 deletions
diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 242bbf92b9..1d5946571d 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2171,7 +2171,7 @@ void SceneObjectList::draw() { Rect tempRect = _globals->_sceneManager._scene->_sceneBounds; tempRect.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); - ScenePalette::changeBackground(tempRect, _globals->_sceneManager._FadeMode); + ScenePalette::changeBackground(tempRect, _globals->_sceneManager._fadeMode); } else { _globals->_paneRegions[CURRENT_PANENUM].draw(); } @@ -2256,7 +2256,7 @@ void SceneObjectList::draw() { // Change the background Rect tempRect = _globals->_sceneManager._scene->_sceneBounds; tempRect.translate(-_globals->_sceneOffset.x, -_globals->_sceneOffset.y); - ScenePalette::changeBackground(tempRect, _globals->_sceneManager._FadeMode); + ScenePalette::changeBackground(tempRect, _globals->_sceneManager._fadeMode); } else { for (uint objIndex = 0; objIndex < objList.size(); ++objIndex) { SceneObject *obj = objList[objIndex]; diff --git a/engines/tsage/ringworld_logic.cpp b/engines/tsage/ringworld_logic.cpp index ab81b7fd25..6c6a446862 100644 --- a/engines/tsage/ringworld_logic.cpp +++ b/engines/tsage/ringworld_logic.cpp @@ -63,6 +63,8 @@ Scene *SceneFactory::createScene(int sceneNumber) { case 1001: return new Scene1001(); // Unused case 1250: return new Scene1250(); + // + case 1400: return new Scene1400(); // Ringworld Space-port case 1500: return new Scene1500(); diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index e36b690c31..e1e72128b5 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -282,7 +282,7 @@ void Scene20::Action1::signal() { _globals->_soundHandler.proc1(this); break; case 3: - _globals->_sceneManager._FadeMode = FADEMODE_GRADUAL; + _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_sceneManager.changeScene(30); // First game scene break; default: @@ -349,7 +349,7 @@ void Scene20::Action2::signal() { break; case 9: SceneItem::display(0, 0, LIST_END); - _globals->_sceneManager._FadeMode = FADEMODE_GRADUAL; + _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_sceneManager.changeScene(40); break; default: @@ -407,7 +407,7 @@ void Scene20::Action3::signal() { _globals->_soundHandler.proc4(); break; case 7: - _globals->_sceneManager._FadeMode = FADEMODE_GRADUAL; + _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; _globals->_sceneManager.changeScene(90); break; default: diff --git a/engines/tsage/ringworld_scenes2.cpp b/engines/tsage/ringworld_scenes2.cpp index e52331e775..b10da21fc3 100644 --- a/engines/tsage/ringworld_scenes2.cpp +++ b/engines/tsage/ringworld_scenes2.cpp @@ -655,6 +655,135 @@ void Scene1250::postInit(SceneObjectList *OwnerList) { } /*-------------------------------------------------------------------------- + * Scene 1400 - Arriving at Ringworld + * + *--------------------------------------------------------------------------*/ + +void Scene1400::Action1::signal() { + Scene1400 *scene = (Scene1400 *)_globals->_sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(5); + break; + case 1: { + SceneItem::display(1400, 0, SET_X, 120, SET_Y, 610, SET_FONT, 2, SET_EXT_BGCOLOUR, 23, SET_KEEP_ONSCREEN, -1, LIST_END); + + Common::Point pt(160, 700); + NpcMover *mover = new NpcMover(); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 2: { + _globals->_player.setStrip2(3); + _globals->_player.changeZoom(100); + + Common::Point pt(160, 100); + NpcMover *mover = new NpcMover(); + _globals->_player.addMover(mover, &pt, this); + SceneItem::display(0, 0); + break; + } + case 3: + SceneItem::display(1400, 2, SET_X, 60, SET_Y, _globals->_sceneManager._scene->_sceneBounds.bottom - 80, + SET_FONT, 2, SET_FG_COLOUR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END); + setDelay(420); + break; + case 4: + SceneItem::display(0, 0); + setDelay(360); + break; + case 5: + SceneItem::display(1400, 3, SET_X, 60, SET_Y, _globals->_sceneManager._scene->_sceneBounds.bottom - 80, + SET_FONT, 2, SET_FG_COLOUR, 23, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END); + setDelay(360); + break; + case 6: + SceneItem::display(0, 0); + break; + case 7: { + _globals->_player._frame = 1; + _globals->_player.setStrip2(1); + _globals->_player._numFrames = 5; + _globals->_player.animate(ANIM_MODE_5, this); + + Common::Point pt(205, 70); + NpcMover *mover = new NpcMover(); + _globals->_player.addMover(mover, &pt, NULL); + _globals->_sceneManager._fadeMode = FADEMODE_NONE; + + scene->loadScene(1402); + break; + } + case 8: + _globals->_player.setStrip2(2); + _globals->_player._numFrames = 10; + _globals->_player.animate(ANIM_MODE_2, NULL); + + SceneItem::display(1400, 4, SET_X, 30, SET_Y, _globals->_player._position.y + 10, SET_FONT, 2, + SET_FG_COLOUR, 13, SET_POS_MODE, 0, SET_KEEP_ONSCREEN, -1, LIST_END); + setDelay(300); + break; + case 9: { + SceneItem::display(0, 0); + Common::Point pt(450, 45); + NpcMover *mover = new NpcMover(); + _globals->_player.addMover(mover, &pt, this); + break; + } + case 10: + _globals->_sceneManager._scrollerRect = Rect(40, 20, 280, 180); + _globals->_sceneManager._fadeMode = FADEMODE_GRADUAL; + _globals->_stripNum = 1500; + _globals->_soundHandler.proc3(); + + _globals->_sceneManager.changeScene(1500); + break; + } +} + +void Scene1400::Action1::dispatch() { + Action::dispatch(); + + if ((_actionIndex > 3) && (_actionIndex < 9)) + _globals->_sceneText.setPosition(Common::Point(60, _globals->_sceneManager._scene->_sceneBounds.bottom - 80)); + + if ((_actionIndex <= 2) && (_globals->_player._percent > 22)) + _globals->_player.changeZoom(100 - (800 - _globals->_player._position.y)); + + if ((_actionIndex >= 9) && (_globals->_player._percent > 22)) + _globals->_player.changeZoom(100 - (_globals->_player._position.x - 205)); +} + +/*--------------------------------------------------------------------------*/ + +void Scene1400::postInit(SceneObjectList *OwnerList) { + if (_globals->_stripNum != 1400) { + loadScene(1401); + } else { + loadScene(1402); + } + Scene::postInit(); + + _globals->_sceneManager._scrollerRect = Rect(40, 90, 280, 180); + _globals->_player.postInit(); + _globals->_player.setVisage(1401); + _globals->_player.animate(ANIM_MODE_2, 0); + _globals->_player.setStrip2(4); + _globals->_player.setPriority2(4); + _globals->_player.disableControl(); + + _globals->_player._moveDiff = Common::Point(4, 2); + _globals->_player.setPosition(Common::Point(160, 800)); + _globals->_sceneManager._scene->_sceneBounds.centre(_globals->_player._position); + _globals->_sceneManager._scene->_sceneBounds.contain(_globals->_sceneManager._scene->_backgroundBounds); + _globals->_sceneOffset.y = (_globals->_sceneManager._scene->_sceneBounds.top / 100) * 100; + + setAction(&_action1); + _globals->_soundHandler.startSound(118); +} + +/*-------------------------------------------------------------------------- * Scene 1500 - Ringworld Space-port * *--------------------------------------------------------------------------*/ diff --git a/engines/tsage/ringworld_scenes2.h b/engines/tsage/ringworld_scenes2.h index 52b4a290fb..7cd72adf1c 100644 --- a/engines/tsage/ringworld_scenes2.h +++ b/engines/tsage/ringworld_scenes2.h @@ -110,6 +110,21 @@ public: virtual void postInit(SceneObjectList *OwnerList = NULL); }; +class Scene1400: public Scene { +public: + /* Actions */ + class Action1: public Action { + public: + virtual void signal(); + virtual void dispatch(); + }; +public: + Action1 _action1; + + virtual void postInit(SceneObjectList *OwnerList = NULL); + +}; + class Scene1500: public Scene { public: /* Actions */ diff --git a/engines/tsage/scenes.cpp b/engines/tsage/scenes.cpp index 709b3ba552..7175fc1371 100644 --- a/engines/tsage/scenes.cpp +++ b/engines/tsage/scenes.cpp @@ -35,7 +35,7 @@ SceneManager::SceneManager() { _hasPalette = false; _sceneNumber = -1; _nextSceneNumber = -1; - _FadeMode = FADEMODE_GRADUAL; + _fadeMode = FADEMODE_GRADUAL; _scrollerRect = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); _saver->addListener(this); } @@ -109,7 +109,7 @@ void SceneManager::fadeInIfNecessary() { if (_hasPalette) { uint32 adjustData = 0; for (int percent = 0; percent < 100; percent += 5) { - if (_globals->_sceneManager._FadeMode == FADEMODE_IMMEDIATE) + if (_globals->_sceneManager._fadeMode == FADEMODE_IMMEDIATE) percent = 100; _globals->_scenePalette.fade((const byte *)&adjustData, false, percent); diff --git a/engines/tsage/scenes.h b/engines/tsage/scenes.h index b5776975be..80030230e8 100644 --- a/engines/tsage/scenes.h +++ b/engines/tsage/scenes.h @@ -81,7 +81,7 @@ public: int _sceneNumber; int _previousScene; int _nextSceneNumber; - FadeMode _FadeMode; + FadeMode _fadeMode; Common::Point _sceneBgOffset; int _sceneLoadCount; Rect _scrollerRect; |