Permalink
Browse files

SLUDGE: Quit game built-in function

  • Loading branch information...
yinsimei committed Aug 3, 2017
1 parent bbc781f commit 7eade8b0318bd969afce4958e27813956fcd5baa
Showing with 5 additions and 4 deletions.
  1. +1 −3 engines/sludge/builtin.cpp
  2. +2 −1 engines/sludge/event.cpp
  3. +2 −0 engines/sludge/event.h
@@ -977,11 +977,9 @@ builtIn(callEvent) {
return BR_CONTINUE;
}
bool reallyWantToQuit = false;
builtIn(quitGame) {
UNUSEDALL
reallyWantToQuit = true;
g_sludge->_evtMan->quitGame();
return BR_CONTINUE;
}
View
@@ -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:
View
@@ -73,13 +73,15 @@ class EventManager {
void restore(FrozenStuffStruct *frozenStuff);
// Quit
void quitGame() { _weAreDoneSoQuit = true; /* _reallyWantToQuit = true; */ }
bool quit() { return _weAreDoneSoQuit; }
private:
SludgeEngine *_vm;
InputType _input;
int _weAreDoneSoQuit;
bool _reallyWantToQuit;
EventHandlers *_currentEvents;
};

0 comments on commit 7eade8b

Please sign in to comment.