From 2a62adc1e0728f26eca970c921f89fb5959d17e2 Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Thu, 10 Nov 2016 14:15:38 +0100 Subject: ADL: Use a quit flag instead of calling quitGame() This makes the game quit promptly instead of waiting for the quit event to come through the pipeline. --- engines/adl/adl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/adl/adl.cpp') diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp index 62f07ad639..ad409b74ee 100644 --- a/engines/adl/adl.cpp +++ b/engines/adl/adl.cpp @@ -58,6 +58,7 @@ AdlEngine::AdlEngine(OSystem *syst, const AdlGameDescription *gd) : _graphics(nullptr), _isRestarting(false), _isRestoring(false), + _isQuitting(false), _skipOneCommand(false), _gameDescription(gd), _saveVerb(0), @@ -553,7 +554,7 @@ Common::Error AdlEngine::run() { _display->setMode(DISPLAY_MODE_MIXED); - while (1) { + while (!_isQuitting) { uint verb = 0, noun = 0; _isRestarting = false; @@ -1101,7 +1102,8 @@ int AdlEngine::o1_quit(ScriptEnv &e) { OP_DEBUG_0("\tQUIT_GAME()"); printMessage(_messageIds.thanksForPlaying); - quitGame(); + // We use _isRestarting to abort the current game loop iteration + _isQuitting = _isRestarting = true; return -1; } -- cgit v1.2.3