diff --git a/engines/ultima/ultima8/games/cru_game.cpp b/engines/ultima/ultima8/games/cru_game.cpp index e725a2ef3d1..177a31e41e9 100644 --- a/engines/ultima/ultima8/games/cru_game.cpp +++ b/engines/ultima/ultima8/games/cru_game.cpp @@ -188,11 +188,7 @@ void CruGame::playDemoScreen() { } } - -void CruGame::playCredits() { - Process *menuproc = new MainMenuProcess(); - Kernel::get_instance()->addProcess(menuproc); - +ProcId CruGame::playCreditsNoMenu() { static const Std::string txt_filename = "static/credits.dat"; static const Std::string bmp_filename = "static/cred.dat"; Common::SeekableReadStream *txtrs = FileSystem::get_instance()->ReadFile(txt_filename); @@ -201,20 +197,29 @@ void CruGame::playCredits() { if (!txtrs) { perr << "RemorseGame::playCredits: error opening credits text: " << txt_filename << Std::endl; - return; + return 0; } if (!bmprs) { perr << "RemorseGame::playCredits: error opening credits background: " << bmp_filename << Std::endl; - return; + return 0; } Gump *creditsgump = new CruCreditsGump(txtrs, bmprs); creditsgump->InitGump(nullptr); creditsgump->CreateNotifier(); Process *notifyproc = creditsgump->GetNotifyProcess(); + return notifyproc->getPid(); +} - if (notifyproc) { - menuproc->waitFor(notifyproc); + +void CruGame::playCredits() { + Process *menuproc = new MainMenuProcess(); + Kernel::get_instance()->addProcess(menuproc); + + ProcId creditsnotify = playCreditsNoMenu(); + + if (creditsnotify) { + menuproc->waitFor(creditsnotify); } } diff --git a/engines/ultima/ultima8/games/cru_game.h b/engines/ultima/ultima8/games/cru_game.h index 15bf3ea00a7..bd8c8fcf36a 100644 --- a/engines/ultima/ultima8/games/cru_game.h +++ b/engines/ultima/ultima8/games/cru_game.h @@ -51,6 +51,9 @@ public: void playCredits() override; void playQuotes() override { }; // no quotes for Crusader void playDemoScreen() override; + + /** Play credits but without showing a menu at the end - just finish. */ + ProcId playCreditsNoMenu(); }; } // End of namespace Ultima8 diff --git a/engines/ultima/ultima8/gumps/cru_menu_gump.cpp b/engines/ultima/ultima8/gumps/cru_menu_gump.cpp index ba8634fb072..7c4ab66cf33 100644 --- a/engines/ultima/ultima8/gumps/cru_menu_gump.cpp +++ b/engines/ultima/ultima8/gumps/cru_menu_gump.cpp @@ -30,6 +30,7 @@ #include "ultima/ultima8/gumps/widgets/button_widget.h" #include "ultima/ultima8/gumps/quit_gump.h" #include "ultima/ultima8/gumps/difficulty_gump.h" +#include "ultima/ultima8/games/cru_game.h" #include "ultima/ultima8/games/game.h" #include "ultima/ultima8/world/actors/main_actor.h" #include "ultima/ultima8/graphics/palette_manager.h" @@ -218,9 +219,12 @@ void CruMenuGump::selectEntry(int entry) { dlg.runModal(); } break; - case 5: // Credits - Game::get_instance()->playCredits(); + case 5: { // Credits + CruGame *game = dynamic_cast(Game::get_instance()); + assert(game); + game->playCreditsNoMenu(); break; + } case 6: // Quit QuitGump::verifyQuit(); break;