TSAGE: Reworked the 'probe approaching rocks' cut-scene to work correctly

The problem is the original game presumed that rendering a single frame would take at least 10 ticks (at 60Hz). Since the ScummVM renders it faster than then, the cutscene wasn't working. A new 'ProbeMover' class has been created to ensure the probe shrinking keeps correct pace with the probe's movement.
This commit is contained in:
Paul Gilbert 2011-04-12 20:16:34 +10:00
parent 1a1e760800
commit d61ad01530
3 changed files with 29 additions and 12 deletions

View File

@ -1127,7 +1127,7 @@ void PaletteRotation::signal() {
void PaletteRotation::remove() {
Action *action = _action;
g_system->getPaletteManager()->setPalette((const byte *)&_palette[0], _start, _end - _start);
g_system->getPaletteManager()->setPalette((const byte *)&_palette[_start], _start, _end - _start);
if (_scenePalette->_listeners.contains(this))
_scenePalette->_listeners.remove(this);

View File

@ -3000,7 +3000,7 @@ void Scene6100::GetBoxAction::signal() {
case 0: {
scene->_turnAmount = 0;
Common::Point pt(scene->_rocks._position.x, scene->_rocks._position.y + 10);
NpcMover *mover = new NpcMover();
ProbeMover *mover = new ProbeMover();
scene->_probe.addMover(mover, &pt, NULL);
scene->_probe.show();
break;
@ -3033,22 +3033,20 @@ void Scene6100::GetBoxAction::signal() {
void Scene6100::GetBoxAction::dispatch() {
Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene;
Action::dispatch();
if (scene->_speed > 0) {
scene->_action5.dispatch();
scene->_speed = (scene->_speed * 4) / 5;
if (scene->_speed == 0)
setDelay(2);
}
if (scene->_speed == 0) {
if (!scene->_probe._mover && (scene->_getBoxAction._actionIndex >= 1)) {
if (scene->_getBoxAction._actionIndex == 1) {
scene->_speed = 0;
scene->_getBoxAction.signal();
}
if (scene->_probe._percent > 4)
// Handle the probe disappearing into the rocks
scene->_probe._percent = scene->_probe._percent * 7 / 8;
scene->_probe._flags |= OBJFLAG_PANES;
}
Action::dispatch();
}
void Scene6100::Action7::signal() {
@ -3068,6 +3066,21 @@ void Scene6100::Action7::signal() {
/*--------------------------------------------------------------------------*/
void Scene6100::ProbeMover::dispatch() {
Scene6100 *scene = (Scene6100 *)_globals->_sceneManager._scene;
if (!dontMove()) {
if (scene->_speed > 0) {
scene->_action5.dispatch();
scene->_speed = (scene->_speed * 4) / 5;
}
}
NpcMover::dispatch();
}
/*--------------------------------------------------------------------------*/
void Scene6100::Item1::doAction(int action) {
SceneItem::display2(4000, 0);
}

View File

@ -509,6 +509,10 @@ class Scene6100: public Scene {
public:
FloatSet _floats;
};
class ProbeMover: public NpcMover {
public:
virtual void dispatch();
};
/* Items */
class Item1: public SceneItem {