aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_graphics.cpp
diff options
context:
space:
mode:
authorDavid Fioramonti2018-08-26 17:39:01 -0700
committerdafioram2018-08-31 16:56:50 -0400
commit33131554c13fbd7d99cc83ccd97193a6c220cc85 (patch)
treec4aa706e18b8a4351e1ddacae93a5b8530cef2f7 /engines/mohawk/riven_graphics.cpp
parent59506d02874679f3233ac8329b9dc2950008f5d5 (diff)
downloadscummvm-rg350-33131554c13fbd7d99cc83ccd97193a6c220cc85.tar.gz
scummvm-rg350-33131554c13fbd7d99cc83ccd97193a6c220cc85.tar.bz2
scummvm-rg350-33131554c13fbd7d99cc83ccd97193a6c220cc85.zip
MOHAWK: RIVEN: Let credits roll longer
Fixes Trac#10675. Previously, the credits ended as soon as the last row was shown of the final credits image. Now some more black rows (empty rows) are shown and finally a few seconds of black. I set it to 8 seconds of wait beyond where the credits where previously stopping. In order to do this updateCredits was enhanced to work past the end of the last credits image (and just keep adding empty rows). The original game shows a black screen for a longer period than this. The credit image numbers are turned into enums.
Diffstat (limited to 'engines/mohawk/riven_graphics.cpp')
-rw-r--r--engines/mohawk/riven_graphics.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/mohawk/riven_graphics.cpp b/engines/mohawk/riven_graphics.cpp
index ac42b1207a..bc6ebfc382 100644
--- a/engines/mohawk/riven_graphics.cpp
+++ b/engines/mohawk/riven_graphics.cpp
@@ -316,7 +316,7 @@ RivenGraphics::RivenGraphics(MohawkEngine_Riven* vm) :
_enableCardUpdateScript(true),
_scheduledTransition(kRivenTransitionNone),
_dirtyScreen(false),
- _creditsImage(302),
+ _creditsImage(kRivenCreditsZeroImage),
_creditsPos(0),
_transitionMode(kRivenTransitionModeFastest),
_transitionOffset(-1),
@@ -657,7 +657,7 @@ void RivenGraphics::beginCredits() {
clearCache();
// Now cache all the credits images
- for (uint16 i = 302; i <= 320; i++) {
+ for (uint16 i = kRivenCreditsZeroImage; i <= kRivenCreditsLastImage; i++) {
MohawkSurface *surface = _bitmapDecoder->decodeImage(_vm->getExtrasResource(ID_TBMP, i));
surface->convertToTrueColor();
addImageToCache(i, surface);
@@ -669,32 +669,32 @@ void RivenGraphics::beginCredits() {
}
void RivenGraphics::updateCredits() {
- if ((_creditsImage == 303 || _creditsImage == 304) && _creditsPos == 0)
+ if ((_creditsImage == kRivenCreditsFirstImage || _creditsImage == kRivenCreditsSecondImage) && _creditsPos == 0)
fadeToBlack();
- if (_creditsImage < 304) {
+ if (_creditsImage < kRivenCreditsSecondImage) {
// For the first two credit images, they are faded from black to the image and then out again
scheduleTransition(kRivenTransitionBlend);
Graphics::Surface *frame = findImage(_creditsImage++)->getSurface();
-
for (int y = 0; y < frame->h; y++)
memcpy(_mainScreen->getBasePtr(124, y), frame->getBasePtr(0, y), frame->pitch);
runScheduledTransition();
} else {
// Otheriwse, 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).
+
// Move the screen up one row
memmove(_mainScreen->getPixels(), _mainScreen->getBasePtr(0, 1), _mainScreen->pitch * (_mainScreen->h - 1));
- // Only update as long as we're not before the last frame
- // Otherwise, we're just moving up a row (which we already did)
- if (_creditsImage <= 320) {
- // Copy the next row to the bottom of the screen
+ // Copy the next row to the bottom of the screen and keep incrementing the credit images and which row we are on until we reach the last.
+ if (_creditsImage <= kRivenCreditsLastImage) {
Graphics::Surface *frame = findImage(_creditsImage)->getSurface();
memcpy(_mainScreen->getBasePtr(124, _mainScreen->h - 1), frame->getBasePtr(0, _creditsPos), frame->pitch);
_creditsPos++;
-
if (_creditsPos == _mainScreen->h) {
_creditsImage++;
_creditsPos = 0;