diff options
-rw-r--r-- | engines/titanic/game/service_elevator_window.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/game/transport/service_elevator.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/support/avi_surface.cpp | 5 |
3 files changed, 10 insertions, 4 deletions
diff --git a/engines/titanic/game/service_elevator_window.cpp b/engines/titanic/game/service_elevator_window.cpp index 13db7a26f8..f49f2fa308 100644 --- a/engines/titanic/game/service_elevator_window.cpp +++ b/engines/titanic/game/service_elevator_window.cpp @@ -61,14 +61,14 @@ void CServiceElevatorWindow::load(SimpleFile *file) { bool CServiceElevatorWindow::ServiceElevatorFloorChangeMsg(CServiceElevatorFloorChangeMsg *msg) { if (getView() == findView()) { CDoorbot *doorbot = dynamic_cast<CDoorbot *>(findRoom()->findByName("Doorbot")); - int val = (_fieldE8 && doorbot) ? 65 : 15; + int fps = (_fieldE8 && doorbot) ? 65 : 15; CMovieClip *clip = _movieClips.findByName("Going Up"); if (!clip) return true; - int count = _endFrame - _startFrame; - setMovieFrameRate(1.0 * count / val); + int count = clip->_endFrame - clip->_startFrame; + setMovieFrameRate(1.0 * count / fps); int startFrame = clip->_startFrame + count * FACTORS[msg->_value1] / 100; int endFrame = clip->_startFrame + count * FACTORS[msg->_value2] / 100; diff --git a/engines/titanic/game/transport/service_elevator.cpp b/engines/titanic/game/transport/service_elevator.cpp index f419bcc0fb..9b109f5fa8 100644 --- a/engines/titanic/game/transport/service_elevator.cpp +++ b/engines/titanic/game/transport/service_elevator.cpp @@ -116,6 +116,7 @@ bool CServiceElevator::ServiceElevatorMsg(CServiceElevatorMsg *msg) { break; case 5: + // Reaching destination floor _fieldF8 = false; _fieldDC = _v3; loadSound("z#423.wav"); @@ -164,6 +165,7 @@ bool CServiceElevator::TimerMsg(CTimerMsg *msg) { if (!isSoundActive(_soundHandle1)) { stopAnimTimer(_timerId); if (msg->_actionVal == 0) { + // Elevator in motion after pressing button _fieldF8 = true; CServiceElevatorFloorChangeMsg changeMsg(_fieldDC, _v3); changeMsg.execute(getRoom()); @@ -174,6 +176,7 @@ bool CServiceElevator::TimerMsg(CTimerMsg *msg) { actMsg.execute(doorbot); } } else { + // Finished playing message for bottom/middle floor disabled enableMouse(); if (doorbot) { CActMsg actMsg; diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index c88c89c6e9..32fa8e4d7c 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -348,7 +348,10 @@ bool AVISurface::addEvent(int frameNumber, CGameObject *obj) { } void AVISurface::setFrameRate(double rate) { - _decoder->setRate(Common::Rational((int)rate)); + // Convert rate from fps to relative to 1.0 (normal speed) + double playRate = rate / 15.0; // Standard 15 FPS + + _decoder->setRate(playRate); } Graphics::ManagedSurface *AVISurface::getSecondarySurface() { |