aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/events.cpp
diff options
context:
space:
mode:
authorChristopher Page2008-06-25 00:55:18 +0000
committerChristopher Page2008-06-25 00:55:18 +0000
commit6e3474896cec0e42c2f5ac7ccb5783981d746fcc (patch)
tree60d70df6441d3d1084853fbe18e7bccc8bad29db /engines/lure/events.cpp
parentc14804e22f5171e6aa7b2cf5d383a4e28180aa7a (diff)
downloadscummvm-rg350-6e3474896cec0e42c2f5ac7ccb5783981d746fcc.tar.gz
scummvm-rg350-6e3474896cec0e42c2f5ac7ccb5783981d746fcc.tar.bz2
scummvm-rg350-6e3474896cec0e42c2f5ac7ccb5783981d746fcc.zip
Kyra and Lure are now using the new _quit flag
svn-id: r32772
Diffstat (limited to 'engines/lure/events.cpp')
-rw-r--r--engines/lure/events.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp
index 30e0e571b7..3d093365f6 100644
--- a/engines/lure/events.cpp
+++ b/engines/lure/events.cpp
@@ -29,6 +29,7 @@
#include "graphics/cursorman.h"
#include "lure/events.h"
+#include "lure/lure.h"
#include "lure/res.h"
namespace Lure {
@@ -137,11 +138,12 @@ void Mouse::setPosition(int newX, int newY) {
void Mouse::waitForRelease() {
Events &e = Events::getReference();
+ LureEngine &engine = LureEngine::getReference();
do {
- while (e.pollEvent() && !e.quitFlag) ;
+ while (e.pollEvent() && !engine._quit) ;
g_system->delayMillis(20);
- } while (!e.quitFlag && (lButton() || rButton() || mButton()));
+ } while (!engine._quit && (lButton() || rButton() || mButton()));
}
/*--------------------------------------------------------------------------*/
@@ -150,7 +152,6 @@ static Events *int_events = NULL;
Events::Events() {
int_events = this;
- quitFlag = false;
}
Events &Events::getReference() {
@@ -159,12 +160,14 @@ Events &Events::getReference() {
bool Events::pollEvent() {
+ LureEngine &engine = LureEngine::getReference();
+
if (!g_system->getEventManager()->pollEvent(_event)) return false;
// Handle keypress
switch (_event.type) {
case Common::EVENT_QUIT:
- quitFlag = true;
+ engine._quit = true;
break;
case Common::EVENT_LBUTTONDOWN:
@@ -210,10 +213,11 @@ void Events::waitForPress() {
bool Events::interruptableDelay(uint32 milliseconds) {
Events &events = Events::getReference();
+ LureEngine &engine = LureEngine::getReference();
uint32 delayCtr = g_system->getMillis() + milliseconds;
while (g_system->getMillis() < delayCtr) {
- if (events.quitFlag) return true;
+ if (engine._quit) return true;
if (events.pollEvent()) {
if (((events.type() == Common::EVENT_KEYDOWN) && (events.event().kbd.ascii != 0)) ||