[Scummvm-git-logs] scummvm master -> 2a62adc1e0728f26eca970c921f89fb5959d17e2

waltervn walter at vanniftrik-it.nl
Thu Nov 10 14:26:36 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2a62adc1e0 ADL: Use a quit flag instead of calling quitGame()


Commit: 2a62adc1e0728f26eca970c921f89fb5959d17e2
    https://github.com/scummvm/scummvm/commit/2a62adc1e0728f26eca970c921f89fb5959d17e2
Author: Walter van Niftrik (walter at scummvm.org)
Date: 2016-11-10T14:15:38+01:00

Commit Message:
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.

Changed paths:
    engines/adl/adl.cpp
    engines/adl/adl.h



diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index 62f07ad..ad409b7 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;
 }
 
diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index 971336e..fc696f0 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -359,7 +359,7 @@ protected:
 	// Game state
 	State _state;
 
-	bool _isRestarting, _isRestoring;
+	bool _isRestarting, _isRestoring, _isQuitting;
 	bool _skipOneCommand;
 
 private:





More information about the Scummvm-git-logs mailing list