aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorChristopher Page2008-07-08 05:21:05 +0000
committerChristopher Page2008-07-08 05:21:05 +0000
commit94beb3037e55803dd45e5720af8320f0ebccb9ac (patch)
tree69a157ac4096149d6f128c43729b9b212098c265 /engines
parentb97f39019cff74f7211152c78e4777ca0e31826e (diff)
downloadscummvm-rg350-94beb3037e55803dd45e5720af8320f0ebccb9ac.tar.gz
scummvm-rg350-94beb3037e55803dd45e5720af8320f0ebccb9ac.tar.bz2
scummvm-rg350-94beb3037e55803dd45e5720af8320f0ebccb9ac.zip
Improved GMM implementation by adding unified quit() and quitGame() methods for all engines. Also implemented a Queue class before and forgot to svn add, common/queue.h is added here.
svn-id: r32958
Diffstat (limited to 'engines')
-rw-r--r--engines/engine.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/engines/engine.h b/engines/engine.h
index 02eea82618..d84ef2bbf8 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -25,6 +25,7 @@
#ifndef ENGINES_ENGINE_H
#define ENGINES_ENGINE_H
+#include "common/events.h"
#include "common/scummsys.h"
#include "common/str.h"
@@ -50,11 +51,7 @@ public:
Audio::Mixer *_mixer;
Common::TimerManager * _timer;
- /** We keep running until this is set to true. */
- bool _quit;
-
- /** This is used when returning from go() to specifiy if we return to the launcher (true), or quit (false). */
- bool _rtl;
+ bool _quit, _rtl;
protected:
Common::EventManager *_eventMan;
@@ -121,10 +118,19 @@ public:
void pauseEngine(bool pause);
/**
+ * Quit the engine, sends a Quit event to the Event Manager
+ */
+ void quitGame() { _eventMan->pushEvent(Common::EVENT_QUIT); };
+
+ /**
* 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(); }
/** Run the Global Main Menu Dialog
*/