[Scummvm-git-logs] scummvm master -> cf5295191562042542a5d351d7c12e2bea3b5458

bgK bastien.bouclet at gmail.com
Mon Jul 2 13:17:01 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
cf52951915 MOHAWK: RIVEN: Fix the credits not showing in the Polish version


Commit: cf5295191562042542a5d351d7c12e2bea3b5458
    https://github.com/scummvm/scummvm/commit/cf5295191562042542a5d351d7c12e2bea3b5458
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2018-07-02T13:17:23+02:00

Commit Message:
MOHAWK: RIVEN: Fix the credits not showing in the Polish version

Fixes Trac#10589

Changed paths:
    engines/mohawk/riven_stack.cpp
    engines/mohawk/riven_stack.h
    engines/mohawk/riven_stacks/ospit.cpp
    engines/mohawk/riven_stacks/rspit.cpp
    engines/mohawk/riven_stacks/tspit.cpp


diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp
index 2a9fb7f..cecb557 100644
--- a/engines/mohawk/riven_stack.cpp
+++ b/engines/mohawk/riven_stack.cpp
@@ -206,16 +206,16 @@ void RivenStack::runDemoBoundaryDialog() {
 	dialog.runModal();
 }
 
-void RivenStack::runEndGame(uint16 videoCode, uint32 delay) {
+void RivenStack::runEndGame(uint16 videoCode, uint32 delay, uint32 videoFrameCountOverride) {
 	_vm->_sound->stopAllSLST();
 	RivenVideo *video = _vm->_video->openSlot(videoCode);
 	video->enable();
 	video->play();
 	video->setLooping(false);
-	runCredits(videoCode, delay);
+	runCredits(videoCode, delay, videoFrameCountOverride);
 }
 
-void RivenStack::runCredits(uint16 video, uint32 delay) {
+void RivenStack::runCredits(uint16 video, uint32 delay, uint32 videoFrameCountOverride) {
 	// Initialize our credits state
 	_vm->_cursor->hideCursor();
 	_vm->_gfx->beginCredits();
@@ -223,9 +223,24 @@ void RivenStack::runCredits(uint16 video, uint32 delay) {
 
 	RivenVideo *videoPtr = _vm->_video->getSlot(video);
 
+	int32 frameCount;
+	if (_vm->getLanguage() == Common::PL_POL && videoFrameCountOverride != 0) {
+		// In the Polish version, the ending videos are not encoded the same way
+		// as with the other languages. In the other versions, the video track
+		// ends after a while, but the audio track keeps going while the credits
+		// are shown.
+		// In the Polish version, the video track keeps going until the end
+		// of the file, but contains only white frames. This workaround stops
+		// displaying the video track just before the first white frame.
+		frameCount = videoFrameCountOverride;
+	} else {
+		frameCount = videoPtr->getFrameCount();
+	}
+
 	while (!_vm->hasGameEnded() && _vm->_gfx->getCurCreditsImage() <= 320) {
-		if (videoPtr->getCurFrame() >= (int32)videoPtr->getFrameCount() - 1) {
+		if (videoPtr->getCurFrame() >= frameCount - 1) {
 			if (nextCreditsFrameStart == 0) {
+				videoPtr->disable();
 				// Set us up to start after delay ms
 				nextCreditsFrameStart = _vm->getTotalPlayTime() + delay;
 			} else if (_vm->getTotalPlayTime() >= nextCreditsFrameStart) {
diff --git a/engines/mohawk/riven_stack.h b/engines/mohawk/riven_stack.h
index 8ab18a5..671f4f9 100644
--- a/engines/mohawk/riven_stack.h
+++ b/engines/mohawk/riven_stack.h
@@ -192,8 +192,8 @@ public:
 	// Miscellaneous
 	uint16 getComboDigit(uint32 correctCombo, uint32 digit);
 	void runDemoBoundaryDialog();
-	void runEndGame(uint16 videoCode, uint32 delay);
-	void runCredits(uint16 video, uint32 delay);
+	void runEndGame(uint16 videoCode, uint32 delay, uint32 videoFrameCountOverride);
+	void runCredits(uint16 video, uint32 delay, uint32 videoFrameCountOverride);
 
 	void pageTurn(RivenTransition transition);
 	bool keepTurningPages();
diff --git a/engines/mohawk/riven_stacks/ospit.cpp b/engines/mohawk/riven_stacks/ospit.cpp
index beecc05..d939bea 100644
--- a/engines/mohawk/riven_stacks/ospit.cpp
+++ b/engines/mohawk/riven_stacks/ospit.cpp
@@ -60,11 +60,11 @@ void OSpit::xorollcredittime(const ArgumentArray &args) {
 	uint32 gehnState = _vm->_vars["agehn"];
 
 	if (gehnState == 0)         // Gehn who?
-		runEndGame(1, 9500);
+		runEndGame(1, 9500, 1225);
 	else if (gehnState == 4)    // You freed him? Are you kidding me?
-		runEndGame(2, 12000);
+		runEndGame(2, 12000, 558);
 	else                        // You already spoke with Gehn. What were you thinking?
-		runEndGame(3, 8000);
+		runEndGame(3, 8000, 857);
 }
 
 void OSpit::xbookclick(const ArgumentArray &args) {
@@ -143,7 +143,7 @@ void OSpit::xbookclick(const ArgumentArray &args) {
 	// Run the credits from here.
 	if (_vm->_vars["agehn"] == 3) {
 		_vm->_scriptMan->stopAllScripts();
-		runCredits(args[0], 5000);
+		runCredits(args[0], 5000, 0);
 		return;
 	}
 
diff --git a/engines/mohawk/riven_stacks/rspit.cpp b/engines/mohawk/riven_stacks/rspit.cpp
index 6d153be..da16499 100644
--- a/engines/mohawk/riven_stacks/rspit.cpp
+++ b/engines/mohawk/riven_stacks/rspit.cpp
@@ -48,7 +48,12 @@ void RSpit::xrcredittime(const ArgumentArray &args) {
 	// For the record, when agehn == 4, Gehn will thank you for
 	// showing him the rebel age and then leave you to die.
 	// Otherwise, the rebels burn the book. Epic fail either way.
-	runEndGame(1, 1500);
+
+	if (_vm->_vars["agehn"] == 4) {
+		runEndGame(1, 1500, 712);
+	} else {
+		runEndGame(1, 1500, 0);
+	}
 }
 
 void RSpit::xrshowinventory(const ArgumentArray &args) {
diff --git a/engines/mohawk/riven_stacks/tspit.cpp b/engines/mohawk/riven_stacks/tspit.cpp
index 3abd0a6..9546d94 100644
--- a/engines/mohawk/riven_stacks/tspit.cpp
+++ b/engines/mohawk/riven_stacks/tspit.cpp
@@ -141,25 +141,25 @@ void TSpit::xtopenfissure() {
 		// The best ending: Catherine is free, Gehn is trapped, Atrus comes to rescue you.
 		// And now we fall back to Earth... all the way...
 		_vm->getCard()->playMovie(8);
-		runEndGame(8, 5000);
+		runEndGame(8, 5000, 2640);
 	} else if (_vm->_vars["agehn"] == 4) {
 		// The ok ending: Catherine is still trapped, Gehn is trapped, Atrus comes to rescue you.
 		// Nice going! Catherine and the islanders are all dead now! Just go back to your home...
 		_vm->getCard()->playMovie(9);
-		runEndGame(9, 5000);
+		runEndGame(9, 5000, 2088);
 	} else if (_vm->_vars["atrapbook"] == 1) {
 		// The bad ending: Catherine is trapped, Gehn is free, Atrus gets shot by Gehn,
 		// And then you get shot by Cho. Nice going! Catherine and the islanders are dead
 		// and you have just set Gehn free from Riven, not to mention you're dead.
 		_vm->getCard()->playMovie(10);
-		runEndGame(10, 5000);
+		runEndGame(10, 5000, 1703);
 	} else {
 		// The impossible ending: You don't have Catherine's journal and yet you were somehow
 		// able to open the hatch on the telescope. The game provides an ending for those who
 		// cheat, load a saved game with the combo, or just guess the telescope combo. Atrus
 		// doesn't come and you just fall into the fissure.
 		_vm->getCard()->playMovie(11);
-		runEndGame(11, 5000);
+		runEndGame(11, 5000, 0);
 	}
 }
 





More information about the Scummvm-git-logs mailing list