diff options
| author | Walter van Niftrik | 2016-11-10 14:15:38 +0100 | 
|---|---|---|
| committer | Walter van Niftrik | 2016-11-10 14:15:38 +0100 | 
| commit | 2a62adc1e0728f26eca970c921f89fb5959d17e2 (patch) | |
| tree | bbd10eea3597f6a7ddc8080d059c30cb2b9abc34 /engines/adl/adl.cpp | |
| parent | 156d1f72217bcdeb5b19209ab2ad05d3a9e710b8 (diff) | |
| download | scummvm-rg350-2a62adc1e0728f26eca970c921f89fb5959d17e2.tar.gz scummvm-rg350-2a62adc1e0728f26eca970c921f89fb5959d17e2.tar.bz2 scummvm-rg350-2a62adc1e0728f26eca970c921f89fb5959d17e2.zip | |
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.
Diffstat (limited to 'engines/adl/adl.cpp')
| -rw-r--r-- | engines/adl/adl.cpp | 6 | 
1 files changed, 4 insertions, 2 deletions
| 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;  } | 
