MOHAWK: RIVEN: Return to main menu after the credits

Like the original the game loop returns to the main menu
after the credits end.

The variable states are reset and the player can start
a new game or load an old one.
This commit is contained in:
David Fioramonti 2018-09-01 03:35:12 -07:00 committed by Bastien Bouclet
parent a66e661df1
commit d7b511b98b
3 changed files with 13 additions and 2 deletions

View File

@ -656,6 +656,9 @@ void RivenGraphics::beginCredits() {
// Clear the old cache
clearCache();
_creditsImage = kRivenCreditsZeroImage;
_creditsPos = 0;
// Now cache all the credits images
for (uint16 i = kRivenCreditsZeroImage; i <= kRivenCreditsLastImage; i++) {
MohawkSurface *surface = _bitmapDecoder->decodeImage(_vm->getExtrasResource(ID_TBMP, i));

View File

@ -258,7 +258,16 @@ void RivenStack::runCredits(uint16 video, uint32 delay, uint32 videoFrameCountOv
_vm->doFrame();
}
_vm->setGameEnded();
videoPtr->stop();
_vm->_cursor->showCursor();
// Clear the game state
_vm->startNewGame();
// Go to the main menu
RivenScriptPtr goToMainMenu = _vm->_scriptMan->createScriptWithCommand(
new RivenStackChangeCommand(_vm, kStackAspit, 1, true, true));
_vm->_scriptMan->runScript(goToMainMenu, true);
}
void RivenStack::installCardTimer() {

View File

@ -142,7 +142,6 @@ void OSpit::xbookclick(const ArgumentArray &args) {
// use the trap book, he will shoot the player. Dead on arrival.
// Run the credits from here.
if (_vm->_vars["agehn"] == 3) {
_vm->_scriptMan->stopAllScripts();
runCredits(args[0], 5000, 995);
return;
}