Permalink
Browse files

MOHAWK: RIVEN: Wait for the sound track to end after the credit

  • Loading branch information...
bgK committed Sep 1, 2018
1 parent 3313155 commit 3c8a0a3d2ea4cf67960a23b77460e6cf95c64d60
Showing with 2 additions and 17 deletions.
  1. +1 −1 engines/mohawk/riven_graphics.cpp
  2. +1 −16 engines/mohawk/riven_stack.cpp
@@ -682,7 +682,7 @@ void RivenGraphics::updateCredits() {
runScheduledTransition();
} else {
// Otheriwse, we're scrolling
// Otherwise, we're scrolling
// This is done by 1) moving the screen up one row and
// 2) adding a new row at the bottom that is the current row of the current image or
// not and it defaults to being empty (a black row).
@@ -237,7 +237,7 @@ void RivenStack::runCredits(uint16 video, uint32 delay, uint32 videoFrameCountOv
frameCount = videoPtr->getFrameCount();
}
while (!_vm->hasGameEnded() && _vm->_gfx->getCurCreditsImage() <= kRivenCreditsLastImage) {
while (!_vm->hasGameEnded() && !videoPtr->endOfVideo()) {
if (videoPtr->getCurFrame() >= frameCount - 1) {
if (nextCreditsFrameStart == 0) {
videoPtr->disable();
@@ -258,21 +258,6 @@ void RivenStack::runCredits(uint16 video, uint32 delay, uint32 videoFrameCountOv
_vm->doFrame();
}
// Let the last frame of credits keep scrolling till black
uint currFrameTime = _vm->getTotalPlayTime();
nextCreditsFrameStart = currFrameTime + 1000 / 60;
uint endFrameTime = currFrameTime + 8000; // 8 seconds
uint sleepTime = 0;
while(currFrameTime < endFrameTime) {
if (sleepTime > 0)
_vm->delay(sleepTime);
nextCreditsFrameStart += 1000 / 60;
_vm->_gfx->updateCredits();
_vm->doFrame();
currFrameTime = _vm->getTotalPlayTime();
sleepTime = nextCreditsFrameStart - currFrameTime;
}
_vm->setGameEnded();
}

0 comments on commit 3c8a0a3

Please sign in to comment.