TSAGE: Initial implementation of Scene #1400 - Arriving at Ringworld

This commit is contained in:
Paul Gilbert 2011-02-27 22:52:35 +11:00
parent b702cd0fdf
commit 2a2a33a14c
7 changed files with 154 additions and 8 deletions

View File

@ -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];

View File

@ -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();

View File

@ -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:

View File

@ -654,6 +654,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
*

View File

@ -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 */

View File

@ -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);

View File

@ -81,7 +81,7 @@ public:
int _sceneNumber;
int _previousScene;
int _nextSceneNumber;
FadeMode _FadeMode;
FadeMode _fadeMode;
Common::Point _sceneBgOffset;
int _sceneLoadCount;
Rect _scrollerRect;