diff options
| author | Max Horn | 2008-09-30 12:27:38 +0000 | 
|---|---|---|
| committer | Max Horn | 2008-09-30 12:27:38 +0000 | 
| commit | 9b160804ab8878b55efb032fb62ee359ab97f848 (patch) | |
| tree | aa0ac6d0aec815de5f2368acc00971948cf3fa0b | |
| parent | 87917e06d94e36c483011deaf1eb4a5dba6eeb97 (diff) | |
| download | scummvm-rg350-9b160804ab8878b55efb032fb62ee359ab97f848.tar.gz scummvm-rg350-9b160804ab8878b55efb032fb62ee359ab97f848.tar.bz2 scummvm-rg350-9b160804ab8878b55efb032fb62ee359ab97f848.zip | |
Renamed Engine::quit to Engine::shouldQuit (previously, it was easily confused with Engine::quitGame); also cleaned up engine.h a bit
svn-id: r34700
97 files changed, 293 insertions, 272 deletions
| diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 3d29f45ea5..53bebf1b40 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -115,7 +115,7 @@ void AgiEngine::interpretCycle() {  	oldSound = getflag(fSoundOn);  	_game.exitAllLogics = false; -	while (runLogic(0) == 0 && !quit()) { +	while (runLogic(0) == 0 && !shouldQuit()) {  		_game.vars[vWordNotFound] = 0;  		_game.vars[vBorderTouchObj] = 0;  		_game.vars[vBorderCode] = 0; @@ -352,16 +352,16 @@ int AgiEngine::playGame() {  			_game.vars[vKey] = 0;  		} -		// FIXME: This has been broken with the merge of the RTL GSoC project. quit() returns a boolean, and we're trying to +		// FIXME: This has been broken with the merge of the RTL GSoC project. shouldQuit() returns a boolean, and we're trying to  		// check it against 0xff, which is never going to be true -		//if (quit() == 0xff) +		//if (shouldQuit() == 0xff)  		//	ec = errRestartGame;  		if (shouldPerformAutoSave(_lastSaveTime)) {  			saveGame(getSavegameFilename(0), "Autosave");  		} -	} while (quit() == 0); +	} while (shouldQuit() == 0);  	_sound->stopSound(); diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 758bff0cb6..186002e8cc 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1739,7 +1739,7 @@ int AgiEngine::runLogic(int n) {  	curLogic->cIP = curLogic->sIP;  	timerHack = 0; -	while (ip < _game.logics[n].size && !quit()) { +	while (ip < _game.logics[n].size && !shouldQuit()) {  		if (_debug.enabled) {  			if (_debug.steps > 0) {  				if (_debug.logic0 || n) { diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp index 393057ed9c..f096c0b2e7 100644 --- a/engines/agi/op_test.cpp +++ b/engines/agi/op_test.cpp @@ -231,7 +231,7 @@ int AgiEngine::testIfCode(int lognum) {  	uint8 p[16] = { 0 };  	bool end_test = false; -	while (retval && !quit() && !end_test) { +	while (retval && !shouldQuit() && !end_test) {  		if (_debug.enabled && (_debug.logic0 || lognum))  			debugConsole(lognum, lTEST_MODE, NULL); diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp index 3cd04351f7..ce085ad165 100644 --- a/engines/agi/preagi_common.cpp +++ b/engines/agi/preagi_common.cpp @@ -120,7 +120,7 @@ void PreAgiEngine::printStrXOR(char *szMsg) {  int PreAgiEngine::getSelection(SelectionTypes type) {  	Common::Event event; -	while (!quit()) { +	while (!shouldQuit()) {  		while (_eventMan->pollEvent(event)) {  			switch(event.type) {  			case Common::EVENT_RTL: diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index f643ab9cfc..db2e01a04b 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -2160,7 +2160,7 @@ void Mickey::run() {  	intro();  	// Game loop -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		drawRoom();  		if (_game.fIntro) { diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index beff721fda..db663797f9 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -56,7 +56,7 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) {  	drawMenu(szMenu, *iSel); -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		while (_vm->_system->getEventManager()->pollEvent(event)) {  			switch(event.type) {  			case Common::EVENT_RTL: @@ -268,7 +268,7 @@ void Troll::tutorial() {  	int iSel = 0;  	//char szTreasure[16] = {0}; -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		_vm->clearScreen(0xFF);  		_vm->printStr(IDS_TRO_TUTORIAL_0); diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index de8839b7bc..c58d7518ac 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -796,7 +796,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {  	// Show the mouse cursor for the menu  	CursorMan.showMouse(true); -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		while (_vm->_system->getEventManager()->pollEvent(event)) {  			switch(event.type) {  			case Common::EVENT_RTL: @@ -1013,7 +1013,7 @@ phase2:  		if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK)  			goto phase1;  	} -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {  			switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) {  			case IDI_WTP_PAR_GOTO: diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 0b308bb37b..179db94a71 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -91,7 +91,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) {  	out->writeSint16BE((int16)_game.lognum);  	out->writeSint16BE((int16)_game.playerControl); -	out->writeSint16BE((int16)quit()); +	out->writeSint16BE((int16)shouldQuit());  	out->writeSint16BE((int16)_game.statusLine);  	out->writeSint16BE((int16)_game.clockEnabled);  	out->writeSint16BE((int16)_game.exitAllLogics); diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 97d84e036c..3968646e63 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -951,7 +951,7 @@ void AGOSEngine::pauseEngineIntern(bool pauseIt) {  void AGOSEngine::pause() {  	pauseEngine(true); -	while (_pause && !quit()) { +	while (_pause && !shouldQuit()) {  		delay(1);  		if (_keyPressed.keycode == Common::KEYCODE_p)  			pauseEngine(false); @@ -988,7 +988,7 @@ int AGOSEngine::go() {  		(getFeatures() & GF_DEMO)) {  		int i; -		while (!quit()) { +		while (!shouldQuit()) {  			for (i = 0; i < 4; i++) {  				setWindowImage(3, 9902 + i);  				debug(0, "Displaying image %d", 9902 + i); @@ -1017,7 +1017,7 @@ int AGOSEngine::go() {  	runSubroutine101();  	permitInput(); -	while (!quit()) { +	while (!shouldQuit()) {  		waitForInput();  		handleVerbClicked(_verbHitArea);  		delay(100); @@ -1074,7 +1074,7 @@ void AGOSEngine::shutdown() {  	delete _moviePlay;  	delete _sound; -	_system->quit(); +	_system->shouldQuit();  }  */ diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp index f4abf19645..9f8b3f8643 100644 --- a/engines/agos/animation.cpp +++ b/engines/agos/animation.cpp @@ -150,7 +150,7 @@ void MoviePlayer::play() {  	startSound(); -	while (_frameNum < _framesCount && !_vm->quit()) +	while (_frameNum < _framesCount && !_vm->shouldQuit())  		handleNextFrame();  	closeFile(); diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 4db3545594..abb7aa056b 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -142,7 +142,7 @@ bool AGOSEngine::kickoffTimeEvents() {  	cur_time = getTime() - _gameStoppedClock; -	while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !quit()) { +	while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !shouldQuit()) {  		result = true;  		_pendingDeleteTimeEvent = te;  		invokeTimeEvent(te); @@ -544,7 +544,7 @@ void AGOSEngine::delay(uint amount) {  		_system->delayMillis(this_delay);  		cur = _system->getMillis(); -	} while (cur < start + amount && !quit()); +	} while (cur < start + amount && !shouldQuit());  }  void AGOSEngine::timer_callback() { diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp index 25a4b919f4..01f254f453 100644 --- a/engines/agos/gfx.cpp +++ b/engines/agos/gfx.cpp @@ -1286,7 +1286,7 @@ void AGOSEngine::setWindowImageEx(uint16 mode, uint16 vga_res) {  		if (getGameType() == GType_WW && (mode == 6 || mode == 8 || mode == 9)) {  			setWindowImage(mode, vga_res);  		} else { -			while (_copyScnFlag && !quit()) +			while (_copyScnFlag && !shouldQuit())  				delay(1);  			setWindowImage(mode, vga_res); diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp index 4327c2878d..8e04f54952 100644 --- a/engines/agos/input.cpp +++ b/engines/agos/input.cpp @@ -123,7 +123,7 @@ void AGOSEngine::setup_cond_c_helper() {  	clearName();  	_lastNameOn = last; -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = 0;  		_leftButtonDown = 0; @@ -145,7 +145,7 @@ void AGOSEngine::setup_cond_c_helper() {  			}  			delay(100); -		} while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !quit()); +		} while ((_lastHitArea3 == (HitArea *) -1 || _lastHitArea3 == 0) && !shouldQuit());  		if (_lastHitArea == NULL) {  		} else if (_lastHitArea->id == 0x7FFB) { @@ -189,12 +189,12 @@ void AGOSEngine::waitForInput() {  		resetVerbs();  	} -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL;  		_dragAccept = 1; -		while (!quit()) { +		while (!shouldQuit()) {  			if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&  					_keyPressed.keycode == Common::KEYCODE_F10)  				displayBoxStars(); diff --git a/engines/agos/oracle.cpp b/engines/agos/oracle.cpp index c174362e7c..dfa3b801d7 100644 --- a/engines/agos/oracle.cpp +++ b/engines/agos/oracle.cpp @@ -459,7 +459,7 @@ void AGOSEngine_Feeble::saveUserGame(int slot) {  	}  	windowPutChar(window, 0x7f); -	while (!quit()) { +	while (!shouldQuit()) {  		_keyPressed.reset();  		delay(1); diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index c1a4e91c95..9314d46a33 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -279,11 +279,11 @@ restart:  	name = buf;  	_saveGameNameLen = 0; -	while (!quit()) { +	while (!shouldQuit()) {  		windowPutChar(window, 128);  		_keyPressed.reset(); -		while (!quit()) { +		while (!shouldQuit()) {  			delay(10);  			if (_keyPressed.ascii && _keyPressed.ascii < 128) {  				i = _keyPressed.ascii; @@ -443,7 +443,7 @@ void AGOSEngine_Elvira2::userGame(bool load) {  		name = buf + 192; -		while (!quit()) { +		while (!shouldQuit()) {  			windowPutChar(window, 128);  			_saveLoadEdit = true; @@ -516,7 +516,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) {  	_keyPressed.reset(); -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; @@ -526,7 +526,7 @@ int AGOSEngine_Elvira2::userGameGetKey(bool *b, char *buf, uint maxChar) {  				return _keyPressed.ascii;  			}  			delay(10); -		} while (_lastHitArea3 == 0 && !quit()); +		} while (_lastHitArea3 == 0 && !shouldQuit());  		ha = _lastHitArea;  		if (ha == NULL || ha->id < 200) { @@ -708,7 +708,7 @@ restart:;  			_saveGameNameLen++;  		} -		while (!quit()) { +		while (!shouldQuit()) {  			windowPutChar(window, 127);  			_saveLoadEdit = true; @@ -787,7 +787,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) {  	_keyPressed.reset(); -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; @@ -797,7 +797,7 @@ int AGOSEngine_Simon1::userGameGetKey(bool *b, char *buf, uint maxChar) {  				return _keyPressed.ascii;  			}  			delay(10); -		} while (_lastHitArea3 == 0 && !quit()); +		} while (_lastHitArea3 == 0 && !shouldQuit());  		ha = _lastHitArea;  		if (ha == NULL || ha->id < 205) { diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 39c172be62..4bcb573e09 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -965,7 +965,7 @@ void AGOSEngine::writeVariable(uint16 variable, uint16 contents) {  int AGOSEngine::runScript() {  	bool flag; -	if (quit()) +	if (shouldQuit())  		return 1;  	do { @@ -1010,9 +1010,9 @@ int AGOSEngine::runScript() {  			error("Invalid opcode '%d' encountered", _opcode);  		executeOpcode(_opcode); -	} while  (getScriptCondition() != flag && !getScriptReturn() && !quit()); +	} while  (getScriptCondition() != flag && !getScriptReturn() && !shouldQuit()); -	return (quit()) ? 1 : getScriptReturn(); +	return (shouldQuit()) ? 1 : getScriptReturn();  }  Child *nextSub(Child *sub, int16 key) { @@ -1066,7 +1066,7 @@ void AGOSEngine::waitForSync(uint a) {  	_exitCutscene = false;  	_rightButtonDown = false; -	while (_vgaWaitFor != 0 && !quit()) { +	while (_vgaWaitFor != 0 && !shouldQuit()) {  		if (_rightButtonDown) {  			if (_vgaWaitFor == 200 && (getGameType() == GType_FF || !getBitFlag(14))) {  				skipSpeech(); diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp index 8705755df6..dbb633ff66 100644 --- a/engines/agos/script_e1.cpp +++ b/engines/agos/script_e1.cpp @@ -1052,11 +1052,11 @@ uint AGOSEngine::confirmYesOrNo(uint16 x, uint16 y) {  	ha->priority = 999;  	ha->window = 0; -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; -		while (!quit()) { +		while (!shouldQuit()) {  			if (_lastHitArea3 != 0)  				break;  			delay(1); @@ -1101,11 +1101,11 @@ uint AGOSEngine::continueOrQuit() {  	ha->priority = 999;  	ha->window = 0; -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; -		while (!quit()) { +		while (!shouldQuit()) {  			if (_lastHitArea3 != 0)  				break;  			delay(1); diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp index 05e457579d..59c5132b0a 100644 --- a/engines/agos/script_e2.cpp +++ b/engines/agos/script_e2.cpp @@ -370,11 +370,11 @@ void AGOSEngine_Elvira2::oe2_pauseGame() {  	uint32 pauseTime = getTime();  	haltAnimation(); -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; -		while (!quit()) { +		while (!shouldQuit()) {  			if (processSpecialKeys() != 0 || _lastHitArea3 != 0)  				break;  			delay(1); diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp index d07f682937..145d4a2694 100644 --- a/engines/agos/script_s1.cpp +++ b/engines/agos/script_s1.cpp @@ -338,7 +338,7 @@ void AGOSEngine_Simon1::os1_pauseGame() {  		break;  	} -	while (!quit()) { +	while (!shouldQuit()) {  		delay(1);  		if (_keyPressed.keycode == keyYes)  			quitGame(); diff --git a/engines/agos/script_ww.cpp b/engines/agos/script_ww.cpp index f0da324fbd..d5da9afe95 100644 --- a/engines/agos/script_ww.cpp +++ b/engines/agos/script_ww.cpp @@ -368,11 +368,11 @@ void AGOSEngine_Waxworks::oww_pauseGame() {  	uint32 pauseTime = getTime();  	haltAnimation(); -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; -		while (!quit()) { +		while (!shouldQuit()) {  			if (_lastHitArea3 != 0)  				break;  			delay(1); diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp index 488ebf4edf..1d4f2e8ba6 100644 --- a/engines/agos/subroutine.cpp +++ b/engines/agos/subroutine.cpp @@ -555,7 +555,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {  	_currentTable = sub;  restart: -	if (quit()) +	if (shouldQuit())  		return result;  	while ((byte *)sl != (byte *)sub) { diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp index 9fd128d764..41e7fee5e1 100644 --- a/engines/agos/verb.cpp +++ b/engines/agos/verb.cpp @@ -343,7 +343,7 @@ void AGOSEngine::handleVerbClicked(uint verb) {  	Subroutine *sub;  	int result; -	if (quit()) +	if (shouldQuit())  		return;  	_objectItem = _hitAreaObjectItem; diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index 87db49e46b..3fb8e9ae5c 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -298,11 +298,11 @@ void AGOSEngine::waitWindow(WindowBlock *window) {  	ha->id = 0x7FFF;  	ha->priority = 999; -	while (!quit()) { +	while (!shouldQuit()) {  		_lastHitArea = NULL;  		_lastHitArea3 = NULL; -		while (!quit()) { +		while (!shouldQuit()) {  			if (_lastHitArea3 != 0)  				break;  			delay(1); diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp index 04c6f5c769..abebe90299 100644 --- a/engines/cine/main_loop.cpp +++ b/engines/cine/main_loop.cpp @@ -419,7 +419,7 @@ void CineEngine::mainLoop(int bootScriptIdx) {  		manageEvents(); -	} while (!quit() && _danKeysPressed != 7); +	} while (!shouldQuit() && _danKeysPressed != 7);  	hideMouse();  	g_sound->stopMusic(); diff --git a/engines/engine.cpp b/engines/engine.cpp index 1d3368b10d..4febccec05 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -168,7 +168,7 @@ void Engine::checkCD() {  		GUI::MessageDialog dialog(  			"You appear to be playing this game directly\n"  			"from the CD. This is known to cause problems,\n" -			"and it's therefore recommended that you copy\n" +			"and it is therefore recommended that you copy\n"  			"the data files to your hard disk instead.\n"  			"See the README file for details.", "OK");  		dialog.runModal(); @@ -224,11 +224,8 @@ void Engine::mainMenuDialog() {  }  int Engine::runDialog(Dialog &dialog) { -	  	pauseEngine(true); -  	int result = dialog.runModal(); -  	pauseEngine(false);  	return result; @@ -254,6 +251,7 @@ void Engine::quitGame() {  }  bool Engine::hasFeature(int f) { +	// TODO: In each engine, keep a ref to the corresponding MetaEngine?  	const EnginePlugin *plugin = 0;  	Common::String gameid = ConfMan.get("gameid");  	gameid.toLowercase(); diff --git a/engines/engine.h b/engines/engine.h index 81e4e6187c..d6954193c5 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -79,6 +79,13 @@ private:  	int _pauseLevel;  public: +	/** @name Overloadable methods +	 * +	 *  All Engine subclasses should consider overloading some or all of the following methods. +	 */ +	//@{ + +  	Engine(OSystem *syst);  	virtual ~Engine(); @@ -96,7 +103,9 @@ public:  	 */  	virtual int go() = 0; -	/** Specific for each engine: prepare error string. */ +	/** +	 * Prepare an error string, which is printed by the error() function. +	 */  	virtual void errorString(const char *buf_input, char *buf_output);  	/** @@ -105,6 +114,35 @@ public:  	 */  	virtual GUI::Debugger *getDebugger() { return 0; } +	/** Sync the engine's sound settings with the config manager +	 */ +	virtual void syncSoundSettings(); + +protected: + +	/** +	 * Actual implementation of pauseEngine by subclasses. See there +	 * for details. +	 */ +	virtual void pauseEngineIntern(bool pause); + +	//@} + + +public: + +	/** +	 * Quit the engine, sends a Quit event to the Event Manager +	 */ +	void quitGame(); + +	// TODO: Rename "quit" to "shouldQuit" +	/** +	 * Return whether or not the ENGINE should quit +	 */ +	bool shouldQuit() const { return (_eventMan->shouldQuit() || _eventMan->shouldRTL()); } + +  	/**  	 * Pause or resume the engine. This should stop/resume any audio playback  	 * and other stuff. Called right before the system runs a global dialog @@ -119,35 +157,26 @@ public:  	void pauseEngine(bool pause);  	/** -	 * Quit the engine, sends a Quit event to the Event Manager -	 */ -	void quitGame(); - -	/**  	 * Return whether the engine is currently paused or not.  	 */  	bool isPaused() const { return _pauseLevel != 0; }  	/** -	 * Return whether or not the ENGINE should quit -	 */ -	bool quit() const { return (_eventMan->shouldQuit() || _eventMan->shouldRTL()); } - -	/** Run the Global Main Menu Dialog +	 * Run the Global Main Menu Dialog  	 */ -	virtual void mainMenuDialog(); +	void mainMenuDialog(); -	/** Sync the engine's sound settings with the config manager -	 */ -	virtual void syncSoundSettings(); - -	/** Determine whether the engine supports the specified MetaEngine feature +	/** +	 * Determine whether the engine supports the specified MetaEngine feature.  	 */ -	virtual bool hasFeature(int f); +	bool hasFeature(int f);  public: -	/** Setup the backend's graphics mode. */ +	/** +	 * Setup the backend's graphics mode. +	 * @todo Must be public because e.g. Saga's Gfx class wants to invoke it. Move it to a better place? +	 */  	void initCommonGFX(bool defaultTo1XScaler);  	/** On some systems, check if the game appears to be run from CD. */ @@ -156,14 +185,12 @@ public:  	/** Indicate whether an autosave should be performed. */  	bool shouldPerformAutoSave(int lastSaveTime); -	/** Initialized graphics and shows error message. */ -	void GUIErrorMessage(const Common::String msg); -  	/** -	 * Actual implementation of pauseEngine by subclasses. See there -	 * for details. +	 * Initialized graphics and shows error message. +	 * @todo Move this to a better place (not just engines need to access it, so it neither +	 *       needs to nor should be contained in class Engine)  	 */ -	virtual void pauseEngineIntern(bool pause); +	void GUIErrorMessage(const Common::String msg);  };  extern Engine *g_engine; diff --git a/engines/gob/game_v1.cpp b/engines/gob/game_v1.cpp index 0ecbc81358..aecdde4309 100644 --- a/engines/gob/game_v1.cpp +++ b/engines/gob/game_v1.cpp @@ -63,7 +63,7 @@ void Game_v1::playTot(int16 skipPlay) {  	strcpy(savedTotName, _curTotFile);  	if (skipPlay <= 0) { -		while (!_vm->quit()) { +		while (!_vm->shouldQuit()) {  			for (int i = 0; i < 4; i++) {  				_vm->_draw->_fontToSprite[i].sprite = -1;  				_vm->_draw->_fontToSprite[i].base = -1; @@ -997,7 +997,7 @@ void Game_v1::collisionsBlock(void) {  		WRITE_VAR(16, 0);  		_activeCollResId = 0;  	} -	while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->quit()); +	while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->shouldQuit());  	if (((uint16) _activeCollResId & ~0x8000) == collResId) {  		collStackPos = 0; diff --git a/engines/gob/game_v2.cpp b/engines/gob/game_v2.cpp index 7d9419b592..9d09fac425 100644 --- a/engines/gob/game_v2.cpp +++ b/engines/gob/game_v2.cpp @@ -70,7 +70,7 @@ void Game_v2::playTot(int16 skipPlay) {  	strcpy(savedTotName, _curTotFile);  	if (skipPlay <= 0) { -		while (!_vm->quit()) { +		while (!_vm->shouldQuit()) {  			if (_vm->_inter->_variables)  				_vm->_draw->animateCursor(4); @@ -438,7 +438,7 @@ int16 Game_v2::checkCollisions(byte handleMouse, int16 deltaTime, int16 *pResId,  	timeKey = _vm->_util->getTimeKey();  	while (1) { -		if (_vm->_inter->_terminate || _vm->quit()) { +		if (_vm->_inter->_terminate || _vm->shouldQuit()) {  			if (handleMouse)  				_vm->_draw->blitCursor();  			return 0; @@ -1043,7 +1043,7 @@ void Game_v2::collisionsBlock(void) {  		WRITE_VAR(16, 0);  		_activeCollResId = 0;  	} -	while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->quit()); +	while ((_activeCollResId == 0) && !_vm->_inter->_terminate && !_vm->shouldQuit());  	if ((_activeCollResId & 0xFFF) == collResId) {  		collStackPos = 0; @@ -1465,7 +1465,7 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,  			key = checkCollisions(handleMouse, -300, collResId, collIndex);  			if ((key != 0) || (*collResId != 0) || -					_vm->_inter->_terminate || _vm->quit()) +					_vm->_inter->_terminate || _vm->shouldQuit())  				break;  			if (*pTotTime > 0) { @@ -1479,7 +1479,7 @@ int16 Game_v2::inputArea(int16 xPos, int16 yPos, int16 width, int16 height,  		}  		if ((key == 0) || (*collResId != 0) || -				_vm->_inter->_terminate || _vm->quit()) +				_vm->_inter->_terminate || _vm->shouldQuit())  			return 0;  		switch (key) { diff --git a/engines/gob/inter.cpp b/engines/gob/inter.cpp index 4973bd756d..fef4c8453d 100644 --- a/engines/gob/inter.cpp +++ b/engines/gob/inter.cpp @@ -259,7 +259,7 @@ void Inter::funcBlock(int16 retFlag) {  		if (executeFuncOpcode(cmd2, cmd, params))  			return; -		if (_vm->quit()) +		if (_vm->shouldQuit())  			break;  		if (_break) { @@ -279,7 +279,7 @@ void Inter::funcBlock(int16 retFlag) {  void Inter::callSub(int16 retFlag) {  	byte block; -	while (!_vm->quit() && _vm->_global->_inter_execPtr && +	while (!_vm->shouldQuit() && _vm->_global->_inter_execPtr &&  			(_vm->_global->_inter_execPtr != _vm->_game->_totFileData)) {  		block = *_vm->_global->_inter_execPtr; diff --git a/engines/gob/inter_bargon.cpp b/engines/gob/inter_bargon.cpp index d23841efd6..0ee7dfaf24 100644 --- a/engines/gob/inter_bargon.cpp +++ b/engines/gob/inter_bargon.cpp @@ -750,7 +750,7 @@ void Inter_Bargon::oBargon_intro2(OpGobParams ¶ms) {  	for (i = 320; i >= 0; i--) {  		_vm->_util->setScrollOffset(i, 0);  		if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == 0x11B) || -				_vm->quit()) { +				_vm->shouldQuit()) {  			_vm->_palAnim->fade(0, -2, 0);  			_vm->_video->clearSurf(_vm->_draw->_frontSurface);  			memset((char *) _vm->_draw->_vgaPalette, 0, 768); @@ -760,7 +760,7 @@ void Inter_Bargon::oBargon_intro2(OpGobParams ¶ms) {  			break;  		}  	} -	if (!_vm->quit()) +	if (!_vm->shouldQuit())  		_vm->_util->setScrollOffset(0, 0);  	surface = 0;  	if (VAR(57) == ((uint32) -1)) @@ -799,7 +799,7 @@ void Inter_Bargon::oBargon_intro3(OpGobParams ¶ms) {  			_vm->_util->longDelay(_vm->_util->getRandom(200));  		}  		if ((_vm->_game->checkKeys(&mouseX, &mouseY, &buttons, 0) == 0x11B) || -				_vm->quit()) { +				_vm->shouldQuit()) {  			_vm->_sound->blasterStop(10);  			_vm->_palAnim->fade(0, -2, 0);  			_vm->_video->clearSurf(_vm->_draw->_frontSurface); diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index 1e01cd9048..0355091c77 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -1234,7 +1234,7 @@ bool Inter_v1::o1_repeatUntil(OpFuncParams ¶ms) {  		funcBlock(1);  		_vm->_global->_inter_execPtr = blockPtr + size + 1;  		flag = evalBoolResult(); -	} while (!flag && !_break && !_terminate && !_vm->quit()); +	} while (!flag && !_break && !_terminate && !_vm->shouldQuit());  	_nestLevel[0]--; @@ -1269,7 +1269,7 @@ bool Inter_v1::o1_whileDo(OpFuncParams ¶ms) {  		} else  			_vm->_global->_inter_execPtr += size; -		if (_break || _terminate || _vm->quit()) { +		if (_break || _terminate || _vm->shouldQuit()) {  			_vm->_global->_inter_execPtr = blockPtr;  			_vm->_global->_inter_execPtr += size;  			break; diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index b245001653..3f1ffba7c1 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -1490,7 +1490,7 @@ void Inter_v2::o2_scroll() {  	curX = startX;  	curY = startY; -	while (!_vm->quit() && ((curX != endX) || (curY != endY))) { +	while (!_vm->shouldQuit() && ((curX != endX) || (curY != endY))) {  		curX = stepX > 0 ? MIN(curX + stepX, (int) endX) :  			MAX(curX + stepX, (int) endX);  		curY = stepY > 0 ? MIN(curY + stepY, (int) endY) : diff --git a/engines/gob/mult.cpp b/engines/gob/mult.cpp index a502e92188..11ef43280f 100644 --- a/engines/gob/mult.cpp +++ b/engines/gob/mult.cpp @@ -209,7 +209,7 @@ void Mult::playMult(int16 startFrame, int16 endFrame, char checkEscape,  		_frame++;  		_vm->_util->waitEndFrame(); -	} while (!stop && !stopNoClear && !_vm->quit()); +	} while (!stop && !stopNoClear && !_vm->shouldQuit());  	if (!stopNoClear) {  		if (_animDataAllocated) { diff --git a/engines/gob/palanim.cpp b/engines/gob/palanim.cpp index 4f2e921dcb..564f7a1a9a 100644 --- a/engines/gob/palanim.cpp +++ b/engines/gob/palanim.cpp @@ -132,7 +132,7 @@ void PalAnim::fade(Video::PalDesc *palDesc, int16 fadeV, int16 allColors) {  	bool stop;  	int16 i; -	if (_vm->quit()) +	if (_vm->shouldQuit())  		return;  	_fadeValue = (fadeV < 0) ? -fadeV : 2; diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp index 7b93003791..78ef69c912 100644 --- a/engines/gob/sound/sound.cpp +++ b/engines/gob/sound/sound.cpp @@ -369,7 +369,7 @@ void Sound::blasterWaitEndPlay(bool interruptible, bool stopComp) {  	if (stopComp)  		_blaster->endComposition(); -	while (_blaster->isPlaying() && !_vm->quit()) { +	while (_blaster->isPlaying() && !_vm->shouldQuit()) {  		if (interruptible && (_vm->_util->checkKey() == 0x11B)) {  			WRITE_VAR(57, (uint32) -1);  			return; diff --git a/engines/gob/util.cpp b/engines/gob/util.cpp index fcf19f03dd..c3c874b2fb 100644 --- a/engines/gob/util.cpp +++ b/engines/gob/util.cpp @@ -71,7 +71,7 @@ void Util::longDelay(uint16 msecs) {  		_vm->_video->waitRetrace();  		processInput();  		delay(15); -	} while (!_vm->quit() && +	} while (!_vm->shouldQuit() &&  	         ((g_system->getMillis() * _vm->_global->_speedFactor) < time));  } diff --git a/engines/gob/videoplayer.cpp b/engines/gob/videoplayer.cpp index daf7bdd801..e36dc19596 100644 --- a/engines/gob/videoplayer.cpp +++ b/engines/gob/videoplayer.cpp @@ -569,7 +569,7 @@ bool VideoPlayer::doPlay(int16 frame, int16 breakKey,  	_vm->_util->processInput(); -	if (_vm->quit()) { +	if (_vm->shouldQuit()) {  		_primaryVideo->getVideo()->disableSound();  		return true;  	} diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp index 6864bd9c4d..06d7f1783a 100644 --- a/engines/kyra/gui.cpp +++ b/engines/kyra/gui.cpp @@ -427,7 +427,7 @@ int MainMenu::handle(int dim) {  	Common::Rect menuRect(x + 16, y + 4, x + width - 16, y + 4 + fh * 4); -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		updateAnimation();  		bool mousePressed = getInput(); @@ -458,7 +458,7 @@ int MainMenu::handle(int dim) {  		_system->delayMillis(10);  	} -	if (_vm->quit()) +	if (_vm->shouldQuit())  		command = -1;  	_screen->copyRegion(backUpX, backUpY, backUpX, backUpY, backUpWidth, backUpHeight, 3, 0); diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index a1391320f4..79db2b8b80 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -514,7 +514,7 @@ void KyraEngine_HoF::bookLoop() {  	showBookPage();  	_bookShown = true; -	while (_bookShown && !quit()) { +	while (_bookShown && !shouldQuit()) {  		checkInput(buttonList);  		removeInputTop(); diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp index 4efffb0eda..e097a422f2 100644 --- a/engines/kyra/gui_lok.cpp +++ b/engines/kyra/gui_lok.cpp @@ -473,7 +473,7 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {  		updateAllMenuButtons();  	} -	while (_displayMenu && !_vm->quit()) { +	while (_displayMenu && !_vm->shouldQuit()) {  		Common::Point mouse = _vm->getMousePos();  		processHighlights(_menu[_toplevelMenu], mouse.x, mouse.y);  		processButtonList(_menuButtonList, 0, 0); @@ -593,7 +593,7 @@ int GUI_LoK::saveGameMenu(Button *button) {  	_displaySubMenu = true;  	_cancelSubMenu = false; -	while (_displaySubMenu && !_vm->quit()) { +	while (_displaySubMenu && !_vm->shouldQuit()) {  		getInput();  		Common::Point mouse = _vm->getMousePos();  		processHighlights(_menu[2], mouse.x, mouse.y); @@ -642,7 +642,7 @@ int GUI_LoK::loadGameMenu(Button *button) {  	_vm->_gameToLoad = -1; -	while (_displaySubMenu && !_vm->quit()) { +	while (_displaySubMenu && !_vm->shouldQuit()) {  		getInput();  		Common::Point mouse = _vm->getMousePos();  		processHighlights(_menu[2], mouse.x, mouse.y); @@ -730,7 +730,7 @@ int GUI_LoK::saveGame(Button *button) {  	}  	redrawTextfield(); -	while (_displaySubMenu && !_vm->quit()) { +	while (_displaySubMenu && !_vm->shouldQuit()) {  		getInput();  		updateSavegameString();  		Common::Point mouse = _vm->getMousePos(); @@ -810,7 +810,7 @@ bool GUI_LoK::quitConfirm(const char *str) {  	_displaySubMenu = true;  	_cancelSubMenu = true; -	while (_displaySubMenu && !_vm->quit()) { +	while (_displaySubMenu && !_vm->shouldQuit()) {  		getInput();  		Common::Point mouse = _vm->getMousePos();  		processHighlights(_menu[1], mouse.x, mouse.y); @@ -876,7 +876,7 @@ int GUI_LoK::gameControlsMenu(Button *button) {  	_displaySubMenu = true;  	_cancelSubMenu = false; -	while (_displaySubMenu && !_vm->quit()) { +	while (_displaySubMenu && !_vm->shouldQuit()) {  		getInput();  		Common::Point mouse = _vm->getMousePos();  		processHighlights(_menu[5], mouse.x, mouse.y); diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 72f214f001..9f6748cd9b 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -870,7 +870,7 @@ void KyraEngine_MR::processAlbum() {  	albumNewPage();  	_album.running = true; -	while (_album.running && !quit()) { +	while (_album.running && !shouldQuit()) {  		updateInput();  		checkInput(buttonList);  		removeInputTop(); diff --git a/engines/kyra/gui_v2.cpp b/engines/kyra/gui_v2.cpp index 077e49ebcf..9c5e86ad98 100644 --- a/engines/kyra/gui_v2.cpp +++ b/engines/kyra/gui_v2.cpp @@ -409,7 +409,7 @@ void GUI_v2::getInput() {  	_vm->checkInput(_menuButtonList);  	_vm->removeInputTop(); -	if (_vm->quit()) { +	if (_vm->shouldQuit()) {  		_displayMenu = false;  		_isLoadMenu = false;  		_isSaveMenu = false; @@ -749,7 +749,7 @@ const char *GUI_v2::nameInputProcess(char *buffer, int x, int y, uint8 c1, uint8  	_keyPressed.reset();  	_cancelNameInput = _finishNameInput = false; -	while (running && !_vm->quit()) { +	while (running && !_vm->shouldQuit()) {  		processHighlights(_savenameMenu, _vm->_mouseX, _vm->_mouseY);  		checkTextfieldInput();  		if (_keyPressed.keycode == Common::KEYCODE_RETURN || _keyPressed.keycode == Common::KEYCODE_KP_ENTER || _finishNameInput) { diff --git a/engines/kyra/kyra_hof.cpp b/engines/kyra/kyra_hof.cpp index 76d6f6ea05..e5043f0c4e 100644 --- a/engines/kyra/kyra_hof.cpp +++ b/engines/kyra/kyra_hof.cpp @@ -317,7 +317,7 @@ int KyraEngine_HoF::go() {  	if (_menuChoice & 1) {  		startup(); -		if (!quit()) +		if (!shouldQuit())  			runLoop();  		cleanup(); @@ -455,7 +455,7 @@ void KyraEngine_HoF::runLoop() {  	_screen->updateScreen();  	_runFlag = true; -	while (!quit() && _runFlag) { +	while (!shouldQuit() && _runFlag) {  		if (_deathHandler >= 0) {  			removeHandItem();  			delay(5); @@ -463,7 +463,7 @@ void KyraEngine_HoF::runLoop() {  			_gui->optionsButton(0);  			_deathHandler = -1; -			if (!_runFlag || !quit()) +			if (!_runFlag || !shouldQuit())  				break;  		} @@ -1630,7 +1630,7 @@ void KyraEngine_HoF::loadInvWsa(const char *filename, int run, int delayTime, in  	_invWsa.timer = _system->getMillis();  	if (run) { -		while (_invWsa.running && !skipFlag() && !quit()) { +		while (_invWsa.running && !skipFlag() && !shouldQuit()) {  			update();  			_system->delayMillis(10);  		} @@ -2004,7 +2004,7 @@ void KyraEngine_HoF::playTim(const char *filename) {  		return;  	_tim->resetFinishedFlag(); -	while (!quit() && !_tim->finished()) { +	while (!shouldQuit() && !_tim->finished()) {  		_tim->exec(tim, 0);  		if (_chatText)  			updateWithText(); diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index f71cc8f409..5a3376a3e6 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -303,7 +303,7 @@ int KyraEngine_LoK::go() {  		if (_gameToLoad == -1) {  			setGameFlag(0xEF);  			seq_intro(); -			if (quit()) +			if (shouldQuit())  				return 0;  			if (_skipIntroFlag && _abortIntroFlag)  				resetGameFlag(0xEF); @@ -402,7 +402,7 @@ void KyraEngine_LoK::startup() {  void KyraEngine_LoK::mainLoop() {  	debugC(9, kDebugLevelMain, "KyraEngine_LoK::mainLoop()"); -	while (!quit()) { +	while (!shouldQuit()) {  		int32 frameTime = (int32)_system->getMillis();  		_skipFlag = false; @@ -449,7 +449,7 @@ void KyraEngine_LoK::mainLoop() {  }  void KyraEngine_LoK::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) { -	while (_system->getMillis() < timestamp && !quit()) { +	while (_system->getMillis() < timestamp && !shouldQuit()) {  		if (updateTimers)  			_timer->update(); @@ -531,19 +531,19 @@ void KyraEngine_LoK::delay(uint32 amount, bool update, bool isMainLoop) {  		if (_skipFlag && !_abortIntroFlag && !queryGameFlag(0xFE))  			_skipFlag = false; -		if (amount > 0 && !_skipFlag && !quit()) +		if (amount > 0 && !_skipFlag && !shouldQuit())  			_system->delayMillis(10);  		if (_skipFlag)  			_sound->voiceStop(); -	} while (!_skipFlag && _system->getMillis() < start + amount && !quit()); +	} while (!_skipFlag && _system->getMillis() < start + amount && !shouldQuit());  }  void KyraEngine_LoK::waitForEvent() {  	bool finished = false;  	Common::Event event; -	while (!finished && !quit()) { +	while (!finished && !shouldQuit()) {  		while (_eventMan->pollEvent(event)) {  			switch (event.type) {  			case Common::EVENT_KEYDOWN: diff --git a/engines/kyra/kyra_mr.cpp b/engines/kyra/kyra_mr.cpp index 9d3171e723..7dea56a5fa 100644 --- a/engines/kyra/kyra_mr.cpp +++ b/engines/kyra/kyra_mr.cpp @@ -263,7 +263,7 @@ int KyraEngine_MR::go() {  		running = false;  	} -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		_screen->_curPage = 0;  		_screen->clearPage(0); @@ -272,14 +272,14 @@ int KyraEngine_MR::go() {  		// XXX  		playMenuAudioFile(); -		for (int i = 0; i < 64 && !quit(); ++i) { +		for (int i = 0; i < 64 && !shouldQuit(); ++i) {  			uint32 nextRun = _system->getMillis() + 3 * _tickLength;  			_menuAnim->displayFrame(i, 0);  			_screen->updateScreen();  			delayUntil(nextRun);  		} -		for (int i = 64; i > 29 && !quit(); --i) { +		for (int i = 64; i > 29 && !shouldQuit(); --i) {  			uint32 nextRun = _system->getMillis() + 3 * _tickLength;  			_menuAnim->displayFrame(i, 0);  			_screen->updateScreen(); @@ -1001,7 +1001,7 @@ void KyraEngine_MR::runLoop() {  	_eventList.clear();  	_runFlag = true; -	while (_runFlag && !quit()) { +	while (_runFlag && !shouldQuit()) {  		if (_deathHandler >= 0) {  			removeHandItem();  			delay(5); @@ -1009,7 +1009,7 @@ void KyraEngine_MR::runLoop() {  			_gui->optionsButton(0);  			_deathHandler = -1; -			if (quit()) +			if (shouldQuit())  				break;  		} diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 8162232935..2a6cfb6f06 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -235,7 +235,7 @@ int KyraEngine_v1::resetGameFlag(int flag) {  }  void KyraEngine_v1::delayUntil(uint32 timestamp, bool updateTimers, bool update, bool isMainLoop) { -	while (_system->getMillis() < timestamp && !quit()) { +	while (_system->getMillis() < timestamp && !shouldQuit()) {  		if (timestamp - _system->getMillis() >= 10)  			delay(10, update, isMainLoop);  	} diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index e9ed91b539..a1124bf98d 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -159,7 +159,7 @@ void KyraEngine_v2::delay(uint32 amount, bool updateGame, bool isMainLoop) {  		if (amount > 0)  			_system->delayMillis(amount > 10 ? 10 : amount); -	} while (!skipFlag() && _system->getMillis() < start + amount && !quit()); +	} while (!skipFlag() && _system->getMillis() < start + amount && !shouldQuit());  }  int KyraEngine_v2::checkInput(Button *buttonList, bool mainLoop) { diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp index 053d8a4de9..91c9b65d1e 100644 --- a/engines/kyra/lol.cpp +++ b/engines/kyra/lol.cpp @@ -297,7 +297,7 @@ void LoLEngine::showIntro() {  	_screen->hideMouse();  	uint32 palNextFadeStep = 0; -	while (!_tim->finished() && !quit() && !skipFlag()) { +	while (!_tim->finished() && !shouldQuit() && !skipFlag()) {  		updateInput();  		_tim->exec(intro, false);  		_screen->checkedPageUpdate(8, 4); @@ -375,14 +375,14 @@ int LoLEngine::chooseCharacter() {  	_screen->fadePalette(_screen->getPalette(0), 30, 0);  	bool kingIntro = true; -	while (!quit()) { +	while (!shouldQuit()) {  		if (kingIntro)  			kingSelectionIntro();  		if (_charSelection < 0)  			processCharacterSelection(); -		if (quit()) +		if (shouldQuit())  			break;  		if (_charSelection == 100) { @@ -403,11 +403,11 @@ int LoLEngine::chooseCharacter() {  		}  	} -	if (quit()) +	if (shouldQuit())  		return -1;  	uint32 waitTime = _system->getMillis() + 420 * _tickLength; -	while (waitTime > _system->getMillis() && !skipFlag() && !quit()) { +	while (waitTime > _system->getMillis() && !skipFlag() && !shouldQuit()) {  		updateInput();  		_system->delayMillis(10);  	} @@ -439,7 +439,7 @@ void LoLEngine::kingSelectionIntro() {  	_chargenWSA->setDrawPage(0);  	int index = 4; -	while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !quit() && !skipFlag()) { +	while (_sound->voiceIsPlaying("KING01") && _charSelection == -1 && !shouldQuit() && !skipFlag()) {  		index = MAX(index, 4);  		_chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0); @@ -450,7 +450,7 @@ void LoLEngine::kingSelectionIntro() {  		_screen->updateScreen();  		uint32 waitEnd = _system->getMillis() + 7 * _tickLength; -		while (waitEnd > _system->getMillis() && _charSelection == -1 && !quit() && !skipFlag()) { +		while (waitEnd > _system->getMillis() && _charSelection == -1 && !shouldQuit() && !skipFlag()) {  			_charSelection = getCharSelection();  			_system->delayMillis(10);  		} @@ -481,7 +481,7 @@ void LoLEngine::kingSelectionReminder() {  	_chargenWSA->setDrawPage(0);  	int index = 0; -	while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !quit() && index < 15) { +	while (_sound->voiceIsPlaying("KING02") && _charSelection == -1 && !shouldQuit() && index < 15) {  		_chargenWSA->displayFrame(_chargenFrameTable[index+9], 0, 0, 0);  		_screen->copyRegion(_selectionPosTable[_reminderChar1IdxTable[index]*2+0], _selectionPosTable[_reminderChar1IdxTable[index]*2+1], _charPreviews[0].x, _charPreviews[0].y, 32, 32, 4, 0);  		_screen->copyRegion(_selectionPosTable[_reminderChar2IdxTable[index]*2+0], _selectionPosTable[_reminderChar2IdxTable[index]*2+1], _charPreviews[1].x, _charPreviews[1].y, 32, 32, 4, 0); @@ -490,7 +490,7 @@ void LoLEngine::kingSelectionReminder() {  		_screen->updateScreen();  		uint32 waitEnd = _system->getMillis() + 8 * _tickLength; -		while (waitEnd > _system->getMillis() && !quit()) { +		while (waitEnd > _system->getMillis() && !shouldQuit()) {  			_charSelection = getCharSelection();  			_system->delayMillis(10);  		} @@ -511,14 +511,14 @@ void LoLEngine::kingSelectionOutro() {  	_chargenWSA->setDrawPage(0);  	int index = 0; -	while (_sound->voiceIsPlaying("KING03") && !quit() && !skipFlag()) { +	while (_sound->voiceIsPlaying("KING03") && !shouldQuit() && !skipFlag()) {  		index = MAX(index, 4);  		_chargenWSA->displayFrame(_chargenFrameTable[index], 0, 0, 0);  		_screen->updateScreen();  		uint32 waitEnd = _system->getMillis() + 8 * _tickLength; -		while (waitEnd > _system->getMillis() && !quit() && !skipFlag()) { +		while (waitEnd > _system->getMillis() && !shouldQuit() && !skipFlag()) {  			updateInput();  			_system->delayMillis(10);  		} @@ -537,10 +537,10 @@ void LoLEngine::processCharacterSelection() {  	debugC(9, kDebugLevelMain, "LoLEngine::processCharacterSelection()");  	_charSelection = -1; -	while (!quit() && _charSelection == -1) { +	while (!shouldQuit() && _charSelection == -1) {  		uint32 nextKingMessage = _system->getMillis() + 900 * _tickLength; -		while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !quit()) { +		while (nextKingMessage > _system->getMillis() && _charSelection == -1 && !shouldQuit()) {  			updateSelectionAnims();  			_charSelection = getCharSelection();  			_system->delayMillis(10); @@ -659,12 +659,12 @@ void LoLEngine::selectionCharInfoIntro(char *file) {  	int index = 0;  	file[4] = '0'; -	while (_charSelectionInfoResult == -1 && !quit()) { +	while (_charSelectionInfoResult == -1 && !shouldQuit()) {  		if (!_sound->voicePlay(file))  			break;  		int i = 0; -		while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !quit()) { +		while (_sound->voiceIsPlaying(file) && _charSelectionInfoResult == -1 && !shouldQuit()) {  			_screen->drawShape(0, _screen->getPtrToShape(_screen->getCPagePtr(9), _charInfoFrameTable[i]), 11, 130, 0, 0);  			_screen->updateScreen(); diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 76089fdb2c..d094dd1ccb 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -179,7 +179,7 @@ Common::SeekableReadStream *KyraEngine_v1::openSaveForReading(const char *filena  Common::WriteStream *KyraEngine_v1::openSaveForWriting(const char *filename, const char *saveName, const Graphics::Surface *thumbnail) const {  	debugC(9, kDebugLevelMain, "KyraEngine_v1::openSaveForWriting('%s', '%s', %p)", filename, saveName, (const void *)thumbnail); -	if (quit()) +	if (shouldQuit())  		return 0;  	Common::WriteStream *out = 0; diff --git a/engines/kyra/saveload_lok.cpp b/engines/kyra/saveload_lok.cpp index f0d9f1ba82..051b844703 100644 --- a/engines/kyra/saveload_lok.cpp +++ b/engines/kyra/saveload_lok.cpp @@ -221,7 +221,7 @@ void KyraEngine_LoK::loadGame(const char *fileName) {  void KyraEngine_LoK::saveGame(const char *fileName, const char *saveName, const Graphics::Surface *thumb) {  	debugC(9, kDebugLevelMain, "KyraEngine_LoK::saveGame('%s', '%s', %p)", fileName, saveName, (const void *)thumb); -	if (quit()) +	if (shouldQuit())  		return;  	Common::OutSaveFile *out = openSaveForWriting(fileName, saveName, thumb); diff --git a/engines/kyra/scene_hof.cpp b/engines/kyra/scene_hof.cpp index df9fccaab9..4785b039d7 100644 --- a/engines/kyra/scene_hof.cpp +++ b/engines/kyra/scene_hof.cpp @@ -277,7 +277,7 @@ int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) {  	int changedScene = 0;  	const int *moveTableStart = moveTable;  	_unk4 = 0; -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (*moveTable >= 0 && *moveTable <= 7) {  			_mainCharacter.facing = getOppositeFacingDirection(*moveTable);  			unkFlag = true; diff --git a/engines/kyra/scene_mr.cpp b/engines/kyra/scene_mr.cpp index ad4ce63b6c..1ceb47155d 100644 --- a/engines/kyra/scene_mr.cpp +++ b/engines/kyra/scene_mr.cpp @@ -654,7 +654,7 @@ int KyraEngine_MR::trySceneChange(int *moveTable, int unk1, int updateChar) {  	const int *moveTableStart = moveTable;  	_unk4 = 0; -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (*moveTable >= 0 && *moveTable <= 7) {  			_mainCharacter.facing = getOppositeFacingDirection(*moveTable);  			unkFlag = true; diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp index 4bcde9a679..d7c603fe11 100644 --- a/engines/kyra/screen.cpp +++ b/engines/kyra/screen.cpp @@ -384,7 +384,7 @@ void Screen::fadePalette(const uint8 *palData, int delay, const UpdateFunctor *u  	getFadeParams(palData, delay, delayInc, diff);  	int delayAcc = 0; -	while (!_vm->quit()) { +	while (!_vm->shouldQuit()) {  		delayAcc += delayInc;  		int refreshed = fadePalStep(palData, diff); @@ -401,7 +401,7 @@ void Screen::fadePalette(const uint8 *palData, int delay, const UpdateFunctor *u  		delayAcc &= 0xFF;  	} -	if (_vm->quit()) { +	if (_vm->shouldQuit()) {  		setScreenPalette(palData);  		if (upFunc && upFunc->isValid())  			(*upFunc)(); @@ -750,7 +750,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag  	int32 start, now;  	int wait; -	for (y = 0; y < h && !_vm->quit(); ++y) { +	for (y = 0; y < h && !_vm->shouldQuit(); ++y) {  		start = (int32)_system->getMillis();  		int y_cur = y;  		for (x = 0; x < w; ++x) { @@ -775,7 +775,7 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag  	copyOverlayRegion(sx, sy, sx, sy, w, h, srcPage, dstPage); -	if (_vm->quit()) { +	if (_vm->shouldQuit()) {  		copyRegion(sx, sy, sx, sy, w, h, srcPage, dstPage);  		_system->updateScreen();  	} diff --git a/engines/kyra/script.cpp b/engines/kyra/script.cpp index dba09f08ef..9635b0b29a 100644 --- a/engines/kyra/script.cpp +++ b/engines/kyra/script.cpp @@ -178,7 +178,7 @@ bool EMCInterpreter::start(EMCState *script, int function) {  }  bool EMCInterpreter::isValid(EMCState *script) { -	if (!script->ip || !script->dataPtr || _vm->quit()) +	if (!script->ip || !script->dataPtr || _vm->shouldQuit())  		return false;  	return true;  } diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp index e965a075bd..b0fc4b860c 100644 --- a/engines/kyra/script_lok.cpp +++ b/engines/kyra/script_lok.cpp @@ -23,7 +23,6 @@   *   */ -  #include "common/endian.h"  #include "common/system.h" diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp index bc71e72ce4..3e709d45e5 100644 --- a/engines/kyra/script_mr.cpp +++ b/engines/kyra/script_mr.cpp @@ -786,7 +786,7 @@ int KyraEngine_MR::o3_daggerWarning(EMCState *script) {  	_screen->_curPage = curPageBackUp;  	_screen->showMouse(); -	while (!quit()) { +	while (!shouldQuit()) {  		int keys = checkInput(0);  		removeInputTop(); diff --git a/engines/kyra/seqplayer.cpp b/engines/kyra/seqplayer.cpp index dfda5bf859..3391c51ab7 100644 --- a/engines/kyra/seqplayer.cpp +++ b/engines/kyra/seqplayer.cpp @@ -625,7 +625,7 @@ bool SeqPlayer::playSequence(const uint8 *seqData, bool skipSeq) {  	memset(_seqMovies, 0, sizeof(_seqMovies));  	_screen->_curPage = 0; -	while (!_seqQuitFlag && !_vm->quit()) { +	while (!_seqQuitFlag && !_vm->shouldQuit()) {  		if (skipSeq && _vm->seq_skipSequence()) {  			while (1) {  				uint8 code = *_seqData; diff --git a/engines/kyra/sequences_hof.cpp b/engines/kyra/sequences_hof.cpp index 7915a33996..718c8dadfa 100644 --- a/engines/kyra/sequences_hof.cpp +++ b/engines/kyra/sequences_hof.cpp @@ -75,7 +75,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {  	_seqEndTime = 0;  	_menuChoice = 0; -	for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) { +	for (int seqNum = startSeq; seqNum <= endSeq && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice); seqNum++) {  		_screen->clearPage(0);  		_screen->clearPage(8);  		memcpy(_screen->getPalette(1), _screen->getPalette(0), 0x300); @@ -131,7 +131,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {  		seq_sequenceCommand(cseq.startupCommand); -		if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +		if (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  			_screen->copyPage(2, 0);  			_screen->updateScreen();  		} @@ -165,7 +165,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {  			_seqWsaCurrentFrame = cseq.startFrame;  			bool loop = true; -			while (loop && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +			while (loop && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  				_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength;  				if (_seqWsa || !cb) @@ -189,16 +189,16 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {  				seq_processWSAs();  				seq_processText(); -				if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +				if ((_seqWsa || !cb) && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  					_screen->copyPage(2, 0);  					_screen->updateScreen();  				}  				bool loop2 = true; -				while (loop2 && !((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +				while (loop2 && !((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  					if (_seqWsa) {  						seq_processText(); -						if (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +						if (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  							_screen->copyPage(2, 0);  							_screen->updateScreen();  						} @@ -230,7 +230,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {  		} else {  			_seqFrameDelay = cseq.frameDelay;  			_seqEndTime = _system->getMillis() + _seqFrameDelay * _tickLength; -			while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +			while (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  				_seqSubFrameStartTime = _system->getMillis();  				seq_processWSAs();  				if (cb) @@ -262,7 +262,7 @@ void KyraEngine_HoF::seq_playSequences(int startSeq, int endSeq) {  			dl = ct;  		_seqEndTime = _system->getMillis() + dl; -		while (!((skipFlag() && allowSkip) || quit() || (_abortIntroFlag && allowSkip) || _menuChoice)) { +		while (!((skipFlag() && allowSkip) || shouldQuit() || (_abortIntroFlag && allowSkip) || _menuChoice)) {  			_seqSubFrameStartTime = _system->getMillis();  			seq_processWSAs(); @@ -2267,7 +2267,7 @@ void KyraEngine_HoF::seq_loadNestedSequence(int wsaNum, int seqNum) {  void KyraEngine_HoF::seq_nestedSequenceFrame(int command, int wsaNum) {  	int xa = 0, ya = 0;  	command--; -	if (!_activeWSA[wsaNum].movie || skipFlag() || quit() || _abortIntroFlag) +	if (!_activeWSA[wsaNum].movie || skipFlag() || shouldQuit() || _abortIntroFlag)  		return;  	switch (command) { @@ -2467,7 +2467,7 @@ bool KyraEngine_HoF::seq_processNextSubFrame(int wsaNum) {  void KyraEngine_HoF::seq_printCreditsString(uint16 strIndex, int x, int y, const uint8 *colorMap, uint8 textcolor) {  	uint8 colormap[16]; -	if (skipFlag() || quit() || _abortIntroFlag || _menuChoice) +	if (skipFlag() || shouldQuit() || _abortIntroFlag || _menuChoice)  		return;  	memset(&_screen->getPalette(0)[0x2fa], 0x3f, 6); @@ -2957,7 +2957,7 @@ void KyraEngine_HoF::seq_makeBookAppear() {  		++_invWsa.curFrame; -		if (_invWsa.curFrame >= _invWsa.lastFrame && !quit()) +		if (_invWsa.curFrame >= _invWsa.lastFrame && !shouldQuit())  			break;  		switch (_invWsa.curFrame) { diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 77cfbed2d0..c9c1a05842 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -163,7 +163,7 @@ void KyraEngine_LoK::seq_introLogos() {  	_screen->updateScreen();  	_screen->fadeFromBlack(); -	if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || quit()) { +	if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag) || shouldQuit()) {  		_screen->fadeToBlack();  		_screen->clearPage(0);  		return; @@ -175,14 +175,14 @@ void KyraEngine_LoK::seq_introLogos() {  		_screen->setScreenPalette(_screen->_currentPalette);  	} -	if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || quit()) { +	if ((_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) || shouldQuit()) {  		_screen->fadeToBlack();  		_screen->clearPage(0);  		return;  	}  	_screen->fillRect(0, 179, 319, 199, 0); -	if (quit()) +	if (shouldQuit())  		return;  	if (_flags.platform == Common::kPlatformAmiga) { @@ -222,10 +222,10 @@ void KyraEngine_LoK::seq_introLogos() {  			oldDistance = distance;  			delay(10); -		} while (!doneFlag && !quit() && !_abortIntroFlag); +		} while (!doneFlag && !shouldQuit() && !_abortIntroFlag);  	} -	if (quit()) +	if (shouldQuit())  		return;  	_seq->playSequence(_seq_Forest, true); @@ -1029,7 +1029,7 @@ void KyraEngine_LoK::seq_brandonToStone() {  void KyraEngine_LoK::seq_playEnding() {  	debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_playEnding()"); -	if (quit()) +	if (shouldQuit())  		return;  	_screen->hideMouse();  	_screen->_curPage = 0; @@ -1210,7 +1210,7 @@ void KyraEngine_LoK::seq_playCredits() {  bool KyraEngine_LoK::seq_skipSequence() const {  	debugC(9, kDebugLevelMain, "KyraEngine_LoK::seq_skipSequence()"); -	return quit() || _abortIntroFlag; +	return shouldQuit() || _abortIntroFlag;  }  int KyraEngine_LoK::handleMalcolmFlag() { diff --git a/engines/kyra/text.cpp b/engines/kyra/text.cpp index eecb617942..379772365c 100644 --- a/engines/kyra/text.cpp +++ b/engines/kyra/text.cpp @@ -23,8 +23,6 @@   *   */ - -  #include "kyra/kyra_v1.h"  #include "kyra/screen.h"  #include "kyra/text.h" diff --git a/engines/kyra/text_hof.cpp b/engines/kyra/text_hof.cpp index b94b8a6258..15681e074c 100644 --- a/engines/kyra/text_hof.cpp +++ b/engines/kyra/text_hof.cpp @@ -335,7 +335,7 @@ void KyraEngine_HoF::objectChatWaitToFinish() {  	const uint32 endTime = _chatEndTime;  	resetSkipFlag(); -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (!_emc->isValid(&_chatScriptState))  			_emc->start(&_chatScriptState, 1); @@ -353,7 +353,7 @@ void KyraEngine_HoF::objectChatWaitToFinish() {  		uint32 nextFrame = _system->getMillis() + delayTime * _tickLength; -		while (_system->getMillis() < nextFrame && !quit()) { +		while (_system->getMillis() < nextFrame && !shouldQuit()) {  			updateWithText();  			const uint32 curTime = _system->getMillis(); @@ -593,7 +593,7 @@ void KyraEngine_HoF::initTalkObject(int index) {  	if (_currentTalkSections.STATim) {  		_tim->resetFinishedFlag(); -		while (!quit() && !_tim->finished()) { +		while (!shouldQuit() && !_tim->finished()) {  			_tim->exec(_currentTalkSections.STATim, false);  			if (_chatText)  				updateWithText(); @@ -609,7 +609,7 @@ void KyraEngine_HoF::deinitTalkObject(int index) {  	if (_currentTalkSections.ENDTim) {  		_tim->resetFinishedFlag(); -		while (!quit() && !_tim->finished()) { +		while (!shouldQuit() && !_tim->finished()) {  			_tim->exec(_currentTalkSections.ENDTim, false);  			if (_chatText)  				updateWithText(); @@ -647,10 +647,10 @@ void KyraEngine_HoF::npcChatSequence(const char *str, int objectId, int vocHigh,  		_chatVocHigh = _chatVocLow = -1;  	} -	while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(quit() || skipFlag())) { +	while (((textEnabled() && _chatEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) && !(shouldQuit() || skipFlag())) {  		if ((!speechEnabled() && chatAnimEndTime > _system->getMillis()) || (speechEnabled() && snd_voiceIsPlaying())) {  			_tim->resetFinishedFlag(); -			while (!_tim->finished() && !skipFlag() && !quit()) { +			while (!_tim->finished() && !skipFlag() && !shouldQuit()) {  				if (_currentTalkSections.TLKTim)  					_tim->exec(_currentTalkSections.TLKTim, false);  				else diff --git a/engines/kyra/text_mr.cpp b/engines/kyra/text_mr.cpp index be306ceec1..41b4c30245 100644 --- a/engines/kyra/text_mr.cpp +++ b/engines/kyra/text_mr.cpp @@ -349,7 +349,7 @@ void KyraEngine_MR::objectChatWaitToFinish() {  	const uint32 endTime = _chatEndTime;  	resetSkipFlag(); -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (!_emc->isValid(&_chatScriptState))  			_emc->start(&_chatScriptState, 1); @@ -367,7 +367,7 @@ void KyraEngine_MR::objectChatWaitToFinish() {  		uint32 nextFrame = _system->getMillis() + delayTime * _tickLength; -		while (_system->getMillis() < nextFrame && !quit()) { +		while (_system->getMillis() < nextFrame && !shouldQuit()) {  			updateWithText();  			const uint32 curTime = _system->getMillis(); @@ -419,7 +419,7 @@ void KyraEngine_MR::badConscienceChatWaitToFinish() {  	uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(4, 8) * _tickLength;  	int frame = _badConscienceFrameTable[_badConscienceAnim+24]; -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (nextFrame < _system->getMillis()) {  			++frame;  			if (_badConscienceFrameTable[_badConscienceAnim+32] < frame) @@ -477,7 +477,7 @@ void KyraEngine_MR::goodConscienceChatWaitToFinish() {  	uint32 nextFrame = _system->getMillis() + _rnd.getRandomNumberRng(3, 6) * _tickLength;  	int frame = _goodConscienceFrameTable[_goodConscienceAnim+15]; -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (nextFrame < _system->getMillis()) {  			++frame;  			if (_goodConscienceFrameTable[_goodConscienceAnim+20] < frame) @@ -597,7 +597,7 @@ void KyraEngine_MR::albumChatWaitToFinish() {  	uint32 nextFrame = 0;  	int frame = 12; -	while (running && !quit()) { +	while (running && !shouldQuit()) {  		if (nextFrame < _system->getMillis()) {  			++frame;  			if (frame > 22) diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index e244f69097..5ca82a9be4 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -141,9 +141,9 @@ void Mouse::waitForRelease() {  	LureEngine &engine = LureEngine::getReference();  	do { -		while (e.pollEvent() && !engine.quit()) ; +		while (e.pollEvent() && !engine.shouldQuit()) ;  		g_system->delayMillis(20); -	} while (!engine.quit() && (lButton() || rButton() || mButton())); +	} while (!engine.shouldQuit() && (lButton() || rButton() || mButton()));  }  /*--------------------------------------------------------------------------*/ @@ -211,7 +211,7 @@ bool Events::interruptableDelay(uint32 milliseconds) {  	uint32 delayCtr = g_system->getMillis() + milliseconds;  	while (g_system->getMillis() < delayCtr) { -		if (engine.quit()) return true; +		if (engine.shouldQuit()) return true;  		if (events.pollEvent()) {  			if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) || diff --git a/engines/lure/fights.cpp b/engines/lure/fights.cpp index 51fce850e6..6ff7339c02 100644 --- a/engines/lure/fights.cpp +++ b/engines/lure/fights.cpp @@ -117,7 +117,7 @@ void FightsManager::fightLoop() {  	uint32 timerVal = g_system->getMillis();  	// Loop for the duration of the battle -	while (!engine.quit() && (playerFight.fwhits != GENERAL_MAGIC_ID)) { +	while (!engine.shouldQuit() && (playerFight.fwhits != GENERAL_MAGIC_ID)) {  		checkEvents();  		if (g_system->getMillis() > timerVal + GAME_FRAME_DELAY) { diff --git a/engines/lure/game.cpp b/engines/lure/game.cpp index 479877f229..cf3d4ac125 100644 --- a/engines/lure/game.cpp +++ b/engines/lure/game.cpp @@ -151,7 +151,7 @@ void Game::execute() {  	bool initialRestart = true; -	while (!engine.quit()) { +	while (!engine.shouldQuit()) {  		if ((_state & GS_RESTART) != 0) {  			res.reset(); @@ -171,7 +171,7 @@ void Game::execute() {  		mouse.cursorOn();  		// Main game loop -		while (!engine.quit() && ((_state & GS_RESTART) == 0)) { +		while (!engine.shouldQuit() && ((_state & GS_RESTART) == 0)) {  			// If time for next frame, allow everything to update  			if (system.getMillis() > timerVal + GAME_FRAME_DELAY) {  				timerVal = system.getMillis(); @@ -1025,7 +1025,7 @@ bool Game::getYN() {  		}  		g_system->delayMillis(10); -	} while (!engine.quit() && !breakFlag); +	} while (!engine.shouldQuit() && !breakFlag);  	screen.update();  	if (!vKbdFlag) diff --git a/engines/lure/intro.cpp b/engines/lure/intro.cpp index b4cbf4a833..a4676984c6 100644 --- a/engines/lure/intro.cpp +++ b/engines/lure/intro.cpp @@ -60,13 +60,13 @@ bool Introduction::showScreen(uint16 screenId, uint16 paletteId, uint16 delaySiz  	screen.update();  	Palette p(paletteId); -	if (LureEngine::getReference().quit()) return true; +	if (LureEngine::getReference().shouldQuit()) return true;  	if (isEGA) screen.setPalette(&p);  	else screen.paletteFadeIn(&p);  	bool result = interruptableDelay(delaySize); -	if (LureEngine::getReference().quit()) return true; +	if (LureEngine::getReference().shouldQuit()) return true;  	if (!isEGA)  		screen.paletteFadeOut(); @@ -84,7 +84,7 @@ bool Introduction::interruptableDelay(uint32 milliseconds) {  	if (events.interruptableDelay(milliseconds)) {  		if (events.type() == Common::EVENT_KEYDOWN)  			return events.event().kbd.keycode == 27; -		else if (LureEngine::getReference().quit()) +		else if (LureEngine::getReference().shouldQuit())  			return true;  		else if (events.type() == Common::EVENT_LBUTTONDOWN)  			return false; diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp index 8cd76cbc73..23737e2f77 100644 --- a/engines/lure/lure.cpp +++ b/engines/lure/lure.cpp @@ -136,7 +136,7 @@ int LureEngine::go() {  			CopyProtectionDialog *dialog = new CopyProtectionDialog();  			bool result = dialog->show();  			delete dialog; -			if (quit()) +			if (shouldQuit())  				return 0;  			if (!result) @@ -153,7 +153,7 @@ int LureEngine::go() {  	}  	// Play the game -	if (!quit()) { +	if (!shouldQuit()) {  		// Play the game  		Sound.loadSection(Sound.isRoland() ? ROLAND_MAIN_SOUND_RESOURCE_ID : ADLIB_MAIN_SOUND_RESOURCE_ID);  		gameInstance->execute(); diff --git a/engines/lure/menu.cpp b/engines/lure/menu.cpp index 562f54da20..112e6116a2 100644 --- a/engines/lure/menu.cpp +++ b/engines/lure/menu.cpp @@ -131,7 +131,7 @@ uint8 Menu::execute() {  	while (mouse.lButton() || mouse.rButton()) {  		while (events.pollEvent()) { -			if (engine.quit()) return MENUITEM_NONE; +			if (engine.shouldQuit()) return MENUITEM_NONE;  			if (mouse.y() < MENUBAR_Y_SIZE) {  				MenuRecord *p = getMenuAt(mouse.x()); @@ -547,7 +547,7 @@ uint16 PopupMenu::Show(int numEntries, const char *actions[]) {  		}  		while (e.pollEvent()) { -			if (engine.quit()) { +			if (engine.shouldQuit()) {  				selectedIndex = 0xffff;  				goto bail_out; diff --git a/engines/lure/scripts.cpp b/engines/lure/scripts.cpp index 495f8046bb..9b073fc1bc 100644 --- a/engines/lure/scripts.cpp +++ b/engines/lure/scripts.cpp @@ -221,7 +221,7 @@ void Script::endgameSequence(uint16 v1, uint16 v2, uint16 v3) {  	anim->show();  	if (!events.interruptableDelay(30000)) {  		// No key yet pressed, so keep waiting -		while (Sound.musicInterface_CheckPlaying(6) && !engine.quit()) { +		while (Sound.musicInterface_CheckPlaying(6) && !engine.shouldQuit()) {  			if (events.interruptableDelay(20))  				break;  		} diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp index 23cc9043cf..01746f39d5 100644 --- a/engines/lure/surface.cpp +++ b/engines/lure/surface.cpp @@ -534,7 +534,7 @@ bool Surface::getString(Common::String &line, int maxSize, bool isNumeric, bool  		// Loop until the input string changes  		refreshFlag = false;  		while (!refreshFlag && !abortFlag) { -			abortFlag = engine.quit(); +			abortFlag = engine.shouldQuit();  			if (abortFlag) break;  			while (events.pollEvent()) { @@ -976,7 +976,7 @@ bool SaveRestoreDialog::show(bool saveDialog) {  		// Provide highlighting of lines to select a save slot  		while (!abortFlag && !(mouse.lButton() && (selectedLine != -1))  				&& !mouse.rButton() && !mouse.mButton()) { -			abortFlag = engine.quit(); +			abortFlag = engine.shouldQuit();  			if (abortFlag) break;  			while (events.pollEvent()) { @@ -1179,7 +1179,7 @@ bool RestartRestoreDialog::show() {  		// Event loop for making selection  		bool buttonPressed = false; -		while (!engine.quit()) { +		while (!engine.shouldQuit()) {  			// Handle events  			while (events.pollEvent()) {  				if ((events.type() == Common::EVENT_LBUTTONDOWN) && (highlightedButton != -1)) { @@ -1231,7 +1231,7 @@ bool RestartRestoreDialog::show() {  	Sound.killSounds(); -	if (!restartFlag && !engine.quit()) { +	if (!restartFlag && !engine.shouldQuit()) {  		// Need to show Restore game dialog  		if (!SaveRestoreDialog::show(false))  			// User cancelled, so fall back on Restart @@ -1351,7 +1351,7 @@ bool CopyProtectionDialog::show() {  		// Clear any prior try  		_charIndex = 0; -		while (!engine.quit()) { +		while (!engine.shouldQuit()) {  			while (events.pollEvent() && (_charIndex < 4)) {  				if (events.type() == Common::EVENT_KEYDOWN) {  					if ((events.event().kbd.keycode == Common::KEYCODE_BACKSPACE) && (_charIndex > 0)) { @@ -1385,7 +1385,7 @@ bool CopyProtectionDialog::show() {  				break;  		} -		if (engine.quit()) +		if (engine.shouldQuit())  			return false;  		// At this point, two page numbers have been entered - validate them diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index 2ce50f498e..9cbb5c33b4 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -357,7 +357,7 @@ void CommandExec::runList(CommandList::iterator first, CommandList::iterator las  	_ctxt.suspend = false;  	for ( ; first != last; first++) { -		if (_vm->quit()) +		if (_vm->shouldQuit())  			break;  		CommandPtr cmd = *first; diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 828cb4d021..b52c4cfba8 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -326,7 +326,7 @@ void Parallaction::processInput(int event) {  void Parallaction::runGame() {  	int event = _input->updateInput(); -	if (quit()) +	if (shouldQuit())  		return;  	runGuiFrame(); @@ -337,7 +337,7 @@ void Parallaction::runGame() {  		processInput(event);  		runPendingZones(); -		if (quit()) +		if (shouldQuit())  			return;  		if (_engineFlags & kEngineChangeLocation) { diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index a06fba43f9..8929efdcbc 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -104,7 +104,7 @@ int Parallaction_br::go() {  	bool splash = true; -	while (!quit()) { +	while (!shouldQuit()) {  		if (getFeatures() & GF_DEMO) {  			scheduleLocationSwitch("camalb.1"); @@ -117,7 +117,7 @@ int Parallaction_br::go() {  //		initCharacter(); -		while (((_engineFlags & kEngineReturn) == 0) && (!quit())) { +		while (((_engineFlags & kEngineReturn) == 0) && (!shouldQuit())) {  			runGame();  		}  		_engineFlags &= ~kEngineReturn; diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 8e11931c28..f4a1ef03ec 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -231,7 +231,7 @@ int Parallaction_ns::go() {  	startGui(); -	while (!quit()) { +	while (!shouldQuit()) {  		runGame();  	} diff --git a/engines/queen/logic.cpp b/engines/queen/logic.cpp index 7fcc761018..053312c584 100644 --- a/engines/queen/logic.cpp +++ b/engines/queen/logic.cpp @@ -2076,7 +2076,7 @@ bool LogicDemo::changeToSpecialRoom() {  		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);  		playCutaway("CLOGO.CUT");  		sceneReset(); -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return true;  		currentRoom(ROOM_HOTEL_LOBBY);  		entryObj(584); @@ -2131,10 +2131,10 @@ bool LogicGame::changeToSpecialRoom() {  	} else if (currentRoom() == FOTAQ_LOGO && gameState(VAR_INTRO_PLAYED) == 0) {  		displayRoom(currentRoom(), RDM_FADE_NOJOE, 100, 2, true);  		playCutaway("COPY.CUT"); -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return true;  		playCutaway("CLOGO.CUT"); -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return true;  		if (_vm->resource()->getPlatform() != Common::kPlatformAmiga) {  			if (ConfMan.getBool("alt_intro") && _vm->resource()->isCD()) { @@ -2143,10 +2143,10 @@ bool LogicGame::changeToSpecialRoom() {  				playCutaway("CDINT.CUT");  			}  		} -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return true;  		playCutaway("CRED.CUT"); -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return true;  		_vm->display()->palSetPanel();  		sceneReset(); diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp index 6cdd020b8f..e242614ad9 100644 --- a/engines/queen/queen.cpp +++ b/engines/queen/queen.cpp @@ -437,7 +437,7 @@ int QueenEngine::go() {  	}  	_lastSaveTime = _lastUpdateTime = _system->getMillis(); -	while (!quit()) { +	while (!shouldQuit()) {  		if (_logic->newRoom() > 0) {  			_logic->update();  			_logic->oldRoom(_logic->currentRoom()); diff --git a/engines/queen/talk.cpp b/engines/queen/talk.cpp index fa2ca669cd..9955ebb856 100644 --- a/engines/queen/talk.cpp +++ b/engines/queen/talk.cpp @@ -807,7 +807,7 @@ void Talk::speakSegment(  	switch (command) {  	case SPEAK_PAUSE: -		for (i = 0; i < 10 && !_vm->input()->talkQuit() && !_vm->quit(); i++) { +		for (i = 0; i < 10 && !_vm->input()->talkQuit() && !_vm->shouldQuit(); i++) {  			_vm->update();  		}  		return; diff --git a/engines/saga/introproc_ihnm.cpp b/engines/saga/introproc_ihnm.cpp index aaa428ca53..685cc5a961 100644 --- a/engines/saga/introproc_ihnm.cpp +++ b/engines/saga/introproc_ihnm.cpp @@ -59,11 +59,11 @@ int Scene::IHNMStartProc() {  		// Play Cyberdreams logo for 168 frames  		if (!playTitle(0, logoLength, true)) { -			if (_vm->quit()) +			if (_vm->shouldQuit())  				return !SUCCESS;  			// Play Dreamers Guild logo for 10 seconds  			if (!playLoopingTitle(1, 10)) { -				if (_vm->quit()) +				if (_vm->shouldQuit())  					return !SUCCESS;  				// Play the title music  				_vm->_music->play(1, MUSIC_NORMAL); @@ -74,7 +74,7 @@ int Scene::IHNMStartProc() {  	} else {  		_vm->_music->play(1, MUSIC_NORMAL);  		playTitle(0, 10); -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return !SUCCESS;  		playTitle(2, 12);  	} @@ -193,7 +193,7 @@ bool Scene::playTitle(int title, int time, int mode) {  	_vm->_gfx->getCurrentPal(pal_cut); -	while (!done && !_vm->quit()) { +	while (!done && !_vm->shouldQuit()) {  		curTime = _vm->_system->getMillis();  		switch (phase) { diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 5ce5d6ab93..7904e60d1c 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -270,7 +270,7 @@ int SagaEngine::go() {  	uint32 currentTicks; -	while (!quit()) { +	while (!shouldQuit()) {  		if (_console->isAttached())  			_console->onFrame(); diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 685bd00065..51176c5df9 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -99,7 +99,7 @@ void CUP_Player::play() {  	debug(1, "rate %d width %d height %d", _playbackRate, _width, _height);  	int ticks = _system->getMillis(); -	while (_dataSize != 0 && !_vm->quit()) { +	while (_dataSize != 0 && !_vm->shouldQuit()) {  		while (parseNextBlockTag(_fileStream)) {  			if (_fileStream.ioFailed()) {  				return; @@ -190,7 +190,7 @@ void CUP_Player::waitForSfxChannel(int channel) {  	CUP_SfxChannel *sfxChannel = &_sfxChannels[channel];  	debug(1, "waitForSfxChannel %d", channel);  	if ((sfxChannel->flags & kSfxFlagLoop) == 0) { -		while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->quit()) { +		while (_mixer->isSoundHandleActive(sfxChannel->handle) && !_vm->shouldQuit()) {  			_vm->parseEvents();  			_system->delayMillis(10);  		} diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index a10af41145..267dd812ae 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -24,7 +24,6 @@   */ -  #include "common/config-manager.h"  #include "common/md5.h"  #include "common/events.h" @@ -1726,7 +1725,7 @@ int ScummEngine::go() {  	int diff = 0;	// Duration of one loop iteration -	while (!quit()) { +	while (!shouldQuit()) {  		if (_debugger->isAttached())  			_debugger->onFrame(); @@ -1759,7 +1758,7 @@ int ScummEngine::go() {  		diff = _system->getMillis() - diff; -		if (quit()) { +		if (shouldQuit()) {  			// TODO: Maybe perform an autosave on exit?  		}  	} @@ -1777,7 +1776,7 @@ void ScummEngine::waitForTimer(int msec_delay) {  	start_time = _system->getMillis(); -	while (!quit()) { +	while (!shouldQuit()) {  		_sound->updateCD(); // Loop CD Audio if needed  		parseEvents();  		_system->updateScreen(); @@ -1900,7 +1899,7 @@ load_game:  	checkExecVerbs();  	checkAndRunSentenceScript(); -	if (quit()) +	if (shouldQuit())  		return;  	// HACK: If a load was requested, immediately perform it. This avoids diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index 3b17f3ae10..55cdc2a25e 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -1254,7 +1254,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st  		}  		if (_endOfFile)  			break; -		if (_vm->quit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) { +		if (_vm->shouldQuit() || _vm->_saveLoadFlag || _vm->_smushVideoShouldFinish) {  			_smixer->stop();  			_vm->_mixer->stopHandle(_compressedFileSoundHandle);  			_vm->_mixer->stopHandle(_IACTchannel); diff --git a/engines/sky/control.cpp b/engines/sky/control.cpp index 8699c893e4..ed2902fe47 100644 --- a/engines/sky/control.cpp +++ b/engines/sky/control.cpp @@ -496,7 +496,7 @@ void Control::doControlPanel(void) {  	_curButtonText = 0;  	uint16 clickRes = 0; -	while (!quitPanel && !g_engine->quit()) { +	while (!quitPanel && !g_engine->shouldQuit()) {  		_text->drawToScreen(WITH_MASK);  		_system->updateScreen();  		_mouseClicked = false; @@ -528,7 +528,7 @@ void Control::doControlPanel(void) {  	}  	memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);  	_system->copyRectToScreen(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT); -	if (!g_engine->quit()) +	if (!g_engine->shouldQuit())  		_system->updateScreen();  	_skyScreen->forceRefresh();  	_skyScreen->setPaletteEndian((uint8 *)_skyCompact->fetchCpt(SkyEngine::_systemVars.currentPalette)); @@ -879,7 +879,7 @@ uint16 Control::saveRestorePanel(bool allowSave) {  	bool refreshNames = true;  	bool refreshAll = true;  	uint16 clickRes = 0; -	while (!quitPanel && !g_engine->quit()) { +	while (!quitPanel && !g_engine->shouldQuit()) {  		clickRes = 0;  		if (refreshNames || refreshAll) {  			if (refreshAll) { diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp index 0900ba5617..5ccdab2ca4 100644 --- a/engines/sky/sky.cpp +++ b/engines/sky/sky.cpp @@ -365,7 +365,7 @@ int SkyEngine::go() {  			introSkipped = !_skyIntro->doIntro(_floppyIntro);  		} -		if (!quit()) { +		if (!shouldQuit()) {  			_skyLogic->initScreen0();  			if (introSkipped)  				_skyControl->restartGame(); @@ -375,7 +375,7 @@ int SkyEngine::go() {  	_lastSaveTime = _system->getMillis();  	uint32 delayCount = _system->getMillis(); -	while (!quit()) { +	while (!shouldQuit()) {  		if (_debugger->isAttached())  			_debugger->onFrame(); diff --git a/engines/sword1/animation.cpp b/engines/sword1/animation.cpp index eb6b6d4dca..36dbadee40 100644 --- a/engines/sword1/animation.cpp +++ b/engines/sword1/animation.cpp @@ -302,7 +302,7 @@ void MoviePlayer::play(void) {  				break;  			}  		} -		if (_vm->quit()) +		if (_vm->shouldQuit())  			terminated = true;  	} diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index d0808d3ece..2e283915fb 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -215,7 +215,7 @@ void Control::askForCd(void) {  				notAccepted = false;  			}  		} -	} while (notAccepted && (!g_engine->quit())); +	} while (notAccepted && (!g_engine->shouldQuit()));  	_resMan->resClose(fontId);  	free(_screenBuf); @@ -317,7 +317,7 @@ uint8 Control::runPanel(void) {  		}  		delay(1000 / 12);  		newMode = getClicks(mode, &retVal); -	} while ((newMode != BUTTON_DONE) && (retVal == 0) && (!g_engine->quit())); +	} while ((newMode != BUTTON_DONE) && (retVal == 0) && (!g_engine->shouldQuit()));  	if (SwordEngine::_systemVars.controlPanelMode == CP_NORMAL) {  		uint8 volL, volR; diff --git a/engines/sword1/credits.cpp b/engines/sword1/credits.cpp index 258784ab53..a3ce402711 100644 --- a/engines/sword1/credits.cpp +++ b/engines/sword1/credits.cpp @@ -125,7 +125,7 @@ void CreditsPlayer::play(void) {  	uint16 renderY = BUFSIZE_Y / 2;  	uint16 clearY = 0xFFFF;  	bool clearLine = false; -	while (((*textData != FNT_EOB) || (scrollY != renderY)) && !g_engine->quit()) { +	while (((*textData != FNT_EOB) || (scrollY != renderY)) && !g_engine->shouldQuit()) {  		if ((int32)_mixer->getSoundElapsedTime(bgSound) - relDelay < (SCROLL_TIMING * 2)) { // sync to audio  			if (scrollY < BUFSIZE_Y - CREDITS_Y)  				_system->copyRectToScreen(screenBuf + scrollY * CREDITS_X, CREDITS_X, START_X, START_Y, CREDITS_X, CREDITS_Y); @@ -175,7 +175,7 @@ void CreditsPlayer::play(void) {  	uint8 *revoBuf = credFile.decompressFile(REVO_LOGO);  	uint8 *revoPal = credFile.fetchFile(REVO_PAL, &_palLen);  	_palLen /= 3; -	while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEUP_TIME) && !g_engine->quit()) { +	while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEUP_TIME) && !g_engine->shouldQuit()) {  		delay(100);  	}  	memset(_palette, 0, 256 * 4); @@ -184,13 +184,13 @@ void CreditsPlayer::play(void) {  	_system->updateScreen();  	fadePalette(revoPal, true, _palLen); -	while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEDOWN_TIME) && !g_engine->quit()) { +	while ((_mixer->getSoundElapsedTime(bgSound) < LOGO_FADEDOWN_TIME) && !g_engine->shouldQuit()) {  		delay(100);  	}  	fadePalette(revoPal, false, _palLen);  	delay(3000); -	if (g_engine->quit()) +	if (g_engine->shouldQuit())  		_mixer->stopAll();  	free(revoBuf);  } @@ -200,7 +200,7 @@ void CreditsPlayer::fadePalette(uint8 *srcPal, bool fadeup, uint16 len) {  	int fadeStart = fadeup ? 0 : 12;  	int relDelay = _system->getMillis(); -	for (int fadeStep = fadeStart; (fadeStep >= 0) && (fadeStep <= 12) && !g_engine->quit(); fadeStep += fadeDir) { +	for (int fadeStep = fadeStart; (fadeStep >= 0) && (fadeStep <= 12) && !g_engine->shouldQuit(); fadeStep += fadeDir) {  		for (uint16 cnt = 0; cnt < len * 3; cnt++)  			_palette[(cnt / 3) * 4 + (cnt % 3)] = (srcPal[cnt] * fadeStep) / 12;  		_system->setPalette(_palette, 0, 256); @@ -293,7 +293,7 @@ void CreditsPlayer::delay(int msecs) {  		if (msecs > 0)  			_system->delayMillis(10); -	} while ((_system->getMillis() < start + msecs) && !g_engine->quit()); +	} while ((_system->getMillis() < start + msecs) && !g_engine->shouldQuit());  }  ArcFile::ArcFile(void) { diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp index 42124d419e..35fe58e819 100644 --- a/engines/sword1/sword1.cpp +++ b/engines/sword1/sword1.cpp @@ -703,7 +703,7 @@ int SwordEngine::go() {  			_systemVars.controlPanelMode = CP_NEWGAME;  			if (_control->runPanel() == CONTROL_GAME_RESTORED)  				_control->doRestore(); -			else if (!quit()) +			else if (!shouldQuit())  				_logic->startPositions(0);  		} else {  			// no savegames, start new game. @@ -712,10 +712,10 @@ int SwordEngine::go() {  	}  	_systemVars.controlPanelMode = CP_NORMAL; -	while (!quit()) { +	while (!shouldQuit()) {  		uint8 action = mainLoop(); -		if (!quit()) { +		if (!shouldQuit()) {  			// the mainloop was left, we have to reinitialize.  			reinitialize();  			if (action == CONTROL_GAME_RESTORED) @@ -756,7 +756,7 @@ uint8 SwordEngine::mainLoop(void) {  	uint8 retCode = 0;  	_keyPressed.reset(); -	while ((retCode == 0) && (!quit())) { +	while ((retCode == 0) && (!shouldQuit())) {  		// do we need the section45-hack from sword.c here?  		checkCd(); @@ -805,9 +805,9 @@ uint8 SwordEngine::mainLoop(void) {  			}  			_mouseState = 0;  			_keyPressed.reset(); -		} while ((Logic::_scriptVars[SCREEN] == Logic::_scriptVars[NEW_SCREEN]) && (retCode == 0) && (!quit())); +		} while ((Logic::_scriptVars[SCREEN] == Logic::_scriptVars[NEW_SCREEN]) && (retCode == 0) && (!shouldQuit())); -		if ((retCode == 0) && (Logic::_scriptVars[SCREEN] != 53) && _systemVars.wantFade && (!quit())) { +		if ((retCode == 0) && (Logic::_scriptVars[SCREEN] != 53) && _systemVars.wantFade && (!shouldQuit())) {  			_screen->fadeDownPalette();  			int32 relDelay = (int32)_system->getMillis();  			while (_screen->stillFading()) { diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 76f14851e7..fb5642a816 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -379,7 +379,7 @@ void MoviePlayer::play(SequenceTextInfo *textList, uint32 numLines, int32 leadIn  	bool startNextText = false;  	// This happens if the user quits during the "eye" cutscene. -	if (_vm->quit()) +	if (_vm->shouldQuit())  		return;  	_numSpeechLines = numLines; diff --git a/engines/sword2/controls.cpp b/engines/sword2/controls.cpp index dcacbc78d4..2596fe594e 100644 --- a/engines/sword2/controls.cpp +++ b/engines/sword2/controls.cpp @@ -396,7 +396,7 @@ int Dialog::runModal() {  		_vm->_system->delayMillis(20); -		if (_vm->quit()) +		if (_vm->shouldQuit())  			setResult(0);  	} @@ -842,7 +842,7 @@ int StartDialog::runModal() {  		if (startDialog.runModal())  			return 1; -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return 0;  		RestoreDialog restoreDialog(_vm); @@ -850,7 +850,7 @@ int StartDialog::runModal() {  		if (restoreDialog.runModal())  			return 0; -		if (_vm->quit()) +		if (_vm->shouldQuit())  			return 0;  	} diff --git a/engines/sword2/palette.cpp b/engines/sword2/palette.cpp index b66a3c9a81..b020359e36 100644 --- a/engines/sword2/palette.cpp +++ b/engines/sword2/palette.cpp @@ -212,7 +212,7 @@ uint8 Screen::getFadeStatus() {  }  void Screen::waitForFade() { -	while (getFadeStatus() != RDFADE_NONE && getFadeStatus() != RDFADE_BLACK && !_vm->quit()) { +	while (getFadeStatus() != RDFADE_NONE && getFadeStatus() != RDFADE_BLACK && !_vm->shouldQuit()) {  		updateDisplay();  		_vm->_system->delayMillis(20);  	} diff --git a/engines/sword2/resman.cpp b/engines/sword2/resman.cpp index 326f90cd82..0add2478a3 100644 --- a/engines/sword2/resman.cpp +++ b/engines/sword2/resman.cpp @@ -412,7 +412,7 @@ Common::File *ResourceManager::openCluFile(uint16 fileNum) {  		// quit while the game is asking for the user to insert a CD.  		// But recovering from this situation gracefully is just too  		// much trouble, so quit now. -		if (_vm->quit()) +		if (_vm->shouldQuit())  			g_system->quit();  		// If the file is supposed to be on hard disk, or we're diff --git a/engines/sword2/screen.cpp b/engines/sword2/screen.cpp index 1faef01939..8319a6731a 100644 --- a/engines/sword2/screen.cpp +++ b/engines/sword2/screen.cpp @@ -389,7 +389,7 @@ void Screen::displayMsg(byte *text, int time) {  		uint32 targetTime = _vm->getMillis() + (time * 1000);  		_vm->sleepUntil(targetTime);  	} else { -		while (!_vm->quit()) { +		while (!_vm->shouldQuit()) {  			MouseEvent *me = _vm->mouseEvent();  			if (me && (me->buttons & (RD_LEFTBUTTONDOWN | RD_RIGHTBUTTONDOWN)))  				break; @@ -1035,7 +1035,7 @@ void Screen::rollCredits() {  	uint32 musicLength = MAX((int32)(1000 * (_vm->_sound->musicTimeRemaining() - 3)), 25 * (int32)scrollSteps); -	while (scrollPos < scrollSteps && !_vm->quit()) { +	while (scrollPos < scrollSteps && !_vm->shouldQuit()) {  		clearScene();  		for (i = startLine; i < lineCount; i++) { @@ -1123,13 +1123,13 @@ void Screen::rollCredits() {  		// The music should either have stopped or be about to stop, so  		// wait for it to really happen. -		while (_vm->_sound->musicTimeRemaining() && !_vm->quit()) { +		while (_vm->_sound->musicTimeRemaining() && !_vm->shouldQuit()) {  			updateDisplay(false);  			_vm->_system->delayMillis(100);  		}  	} -	if (_vm->quit()) +	if (_vm->shouldQuit())  		return;  	waitForFade(); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index dc884eaacb..b6ee7cfcd0 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -421,7 +421,7 @@ int Sword2Engine::init() {  		// player will kill the music for us. Otherwise, the restore  		// will either have killed the music, or done a crossfade. -		if (quit()) +		if (shouldQuit())  			return 0;  		if (result) @@ -493,7 +493,7 @@ int Sword2Engine::go() {  		// because we want the break to happen before updating the  		// screen again. -		if (quit()) +		if (shouldQuit())  			break;  		// creates the debug text blocks diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp index 7fb949704a..1ac36efb13 100644 --- a/engines/tinsel/tinsel.cpp +++ b/engines/tinsel/tinsel.cpp @@ -740,7 +740,7 @@ int TinselEngine::go() {  	// Foreground loop -	while (!quit()) { +	while (!shouldQuit()) {  		assert(_console);  		if (_console->isAttached())  			_console->onFrame(); diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index 82490fca38..9da76dadde 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -433,7 +433,7 @@ void ToucheEngine::handleOptions(int forceDisplay) {  			_system->delayMillis(10);  		}  		_fullRedrawCounter = 2; -		if (!menuData.exit && quit()) { +		if (!menuData.exit && shouldQuit()) {  			if (displayQuitDialog())  				quitGame();  		} diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index e122187dcd..26170e2734 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -268,7 +268,7 @@ void ToucheEngine::mainLoop() {  	}  	uint32 frameTimeStamp = _system->getMillis(); -	for (uint32 cycleCounter = 0; !quit(); ++cycleCounter) { +	for (uint32 cycleCounter = 0; !shouldQuit(); ++cycleCounter) {  		if ((cycleCounter % 3) == 0) {  			runCycle();  		} @@ -1837,7 +1837,7 @@ int ToucheEngine::handleActionMenuUnderCursor(const int16 *actions, int offs, in  	_menuRedrawCounter = 2;  	Common::Rect rect(0, y, kScreenWidth, y + h);  	i = -1; -	while (_inp_rightMouseButtonPressed && !quit()) { +	while (_inp_rightMouseButtonPressed && !shouldQuit()) {  		Common::Point mousePos = getMousePos();  		if (rect.contains(mousePos)) {  			int c = (mousePos.y - y) / kTextHeight; | 
