KINGDOM: Fix skipping and quitting demo movie (#5372)

The detection that the demo movie was skipped is done by the external flag _demoMovieSkipped

This is not as clean as it would be updating a reference parameter variable from within playMovie()
but that would require changing the signature of playMovie and all of its calls
This commit is contained in:
Athanasios Antoniou 2023-10-22 03:34:30 +03:00 committed by GitHub
parent d836ec97ed
commit c9c03d6995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 3 deletions

View File

@ -55,6 +55,7 @@ KingdomGame::KingdomGame(OSystem *syst, const ADGameDescription *gameDesc) : Eng
_asPtr = nullptr;
_quit = false;
_demoMovieSkipped = false;
_kingartEntries = nullptr;
_tickCount = 0;
@ -527,6 +528,9 @@ void KingdomGame::playMovie(int movieNum) {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_ESCAPE) {
skipMovie = true;
if (movieNum == 54) {
_demoMovieSkipped = true;
}
}
default:
break;

View File

@ -151,6 +151,7 @@ namespace Kingdom {
bool _iconsClosed;
bool _oldIconsClosed;
int _pMovie;
bool _demoMovieSkipped;
bool _keyActive;
bool _iconRedraw;
bool _quit;

View File

@ -505,10 +505,12 @@ void Logic::gameHelp() {
// The demo isn't saving pMovie.
// It's obviously a bug and this behavior wasn't kept in ScummVM
int oldPMovie = _vm->_pMovie;
while(!_vm->_keyActive) {
_vm->_demoMovieSkipped = false;
while(!_vm->_keyActive && !_vm->shouldQuit() && !_vm->_demoMovieSkipped) {
_vm->playMovie(54);
_vm->fadeToBlack2();
}
_vm->_demoMovieSkipped = false;
_vm->_pMovie = oldPMovie;
_vm->_noIFScreen = false;
_vm->showPic(106);

View File

@ -54,11 +54,13 @@ void Logic::GPL1_11() {
_vm->_keyActive = false;
_vm->_noIFScreen = true;
_vm->playSound(0);
while(!_vm->_keyActive) {
_vm->_demoMovieSkipped = false;
while(!_vm->_keyActive && !_vm->shouldQuit() && !_vm->_demoMovieSkipped) {
_vm->fadeToBlack2();
_vm->playMovie(54);
}
GPLogic1_SubSP10();
_vm->_demoMovieSkipped = false;
GPLogic1_SubSP10(); // return to main menu
break;
case 0x194:
// CHECKME _QuitFlag = 2;
@ -75,7 +77,9 @@ void Logic::GPL1_11() {
_vm->_cursorDrawn = false;
_vm->fadeToBlack2();
_vm->playSound(0);
_vm->_demoMovieSkipped = false;
_vm->playMovie(54);
_vm->_demoMovieSkipped = false;
GPLogic1_SubSP10();
break;
default: