From 7eade8b0318bd969afce4958e27813956fcd5baa Mon Sep 17 00:00:00 2001 From: Simei Yin Date: Thu, 3 Aug 2017 04:14:35 +0200 Subject: SLUDGE: Quit game built-in function --- engines/sludge/builtin.cpp | 4 +--- engines/sludge/event.cpp | 3 ++- engines/sludge/event.h | 2 ++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp index 01d58a0815..6d7d571638 100644 --- a/engines/sludge/builtin.cpp +++ b/engines/sludge/builtin.cpp @@ -977,11 +977,9 @@ builtIn(callEvent) { return BR_CONTINUE; } -bool reallyWantToQuit = false; - builtIn(quitGame) { UNUSEDALL - reallyWantToQuit = true; + g_sludge->_evtMan->quitGame(); return BR_CONTINUE; } diff --git a/engines/sludge/event.cpp b/engines/sludge/event.cpp index 221140055c..c2997be078 100644 --- a/engines/sludge/event.cpp +++ b/engines/sludge/event.cpp @@ -43,6 +43,7 @@ EventManager::EventManager(SludgeEngine *vm) { _vm = vm; _weAreDoneSoQuit = 0; + _reallyWantToQuit = false; _input.leftClick = _input.rightClick = _input.justMoved = _input.leftRelease = _input.rightRelease = false; _input.keyPressed = 0; @@ -129,7 +130,7 @@ void EventManager::checkInput() { case Common::EVENT_QUIT: _weAreDoneSoQuit = 1; - // TODO: if reallyWantToQuit, popup a message box to confirm + // TODO: if _reallyWantToQuit, popup a message box to confirm break; default: diff --git a/engines/sludge/event.h b/engines/sludge/event.h index ddb973f4ec..691a0daa82 100644 --- a/engines/sludge/event.h +++ b/engines/sludge/event.h @@ -73,6 +73,7 @@ public: void restore(FrozenStuffStruct *frozenStuff); // Quit + void quitGame() { _weAreDoneSoQuit = true; /* _reallyWantToQuit = true; */ } bool quit() { return _weAreDoneSoQuit; } private: @@ -80,6 +81,7 @@ private: InputType _input; int _weAreDoneSoQuit; + bool _reallyWantToQuit; EventHandlers *_currentEvents; }; -- cgit v1.2.3