aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorRobert Špalek2010-01-10 01:25:37 +0000
committerRobert Špalek2010-01-10 01:25:37 +0000
commit96068d30d937c5529e730ac61fd1ba26f69d7706 (patch)
tree9257671dcab1e2b5d16f3e4a11ba79aad6c82f5e /engines
parent2c1ef90b8766d1abf2e484de989913e29436234c (diff)
downloadscummvm-rg350-96068d30d937c5529e730ac61fd1ba26f69d7706.tar.gz
scummvm-rg350-96068d30d937c5529e730ac61fd1ba26f69d7706.tar.bz2
scummvm-rg350-96068d30d937c5529e730ac61fd1ba26f69d7706.zip
Handle properly shouldQuit()
svn-id: r47215
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/draci.cpp11
-rw-r--r--engines/draci/game.cpp4
-rw-r--r--engines/draci/game.h2
3 files changed, 9 insertions, 8 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index e098dc969e..ff3815ffb7 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -223,11 +223,6 @@ void DraciEngine::handleEvents() {
while (_eventMan->pollEvent(event)) {
switch (event.type) {
- case Common::EVENT_QUIT:
- case Common::EVENT_RTL:
- _game->setQuit(true);
- _script->endCurrentProgram(true);
- break;
case Common::EVENT_KEYDOWN:
switch (event.kbd.keycode) {
case Common::KEYCODE_RIGHT:
@@ -310,6 +305,12 @@ void DraciEngine::handleEvents() {
_mouse->handleEvent(event);
}
}
+
+ // Handle EVENT_QUIT and EVENT_RTL.
+ if (shouldQuit()) {
+ _game->setQuit(true);
+ _script->endCurrentProgram(true);
+ }
}
DraciEngine::~DraciEngine() {
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 592863b12b..0e6c5e7b90 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -158,7 +158,7 @@ Game::Game(DraciEngine *vm) : _vm(vm), _walkingState(vm) {
}
void Game::start() {
- while (!shouldQuit()) {
+ while (!gameShouldQuit()) {
// Reset the flag allowing to run the scripts.
_vm->_script->endCurrentProgram(false);
@@ -453,7 +453,7 @@ void Game::advanceAnimationsAndTestLoopExit() {
}
// This returns true if we got a signal to quit the game
- if (shouldQuit()) {
+ if (gameShouldQuit()) {
setExitLoop(true);
}
diff --git a/engines/draci/game.h b/engines/draci/game.h
index e2aa1dcced..cd1e5c5dd6 100644
--- a/engines/draci/game.h
+++ b/engines/draci/game.h
@@ -278,7 +278,7 @@ public:
LoopStatus getLoopStatus() const { return _loopStatus; }
LoopSubstatus getLoopSubstatus() const { return _loopSubstatus; }
- bool shouldQuit() const { return _shouldQuit; }
+ bool gameShouldQuit() const { return _shouldQuit; }
void setQuit(bool quit) { _shouldQuit = quit; }
bool shouldExitLoop() const { return _shouldExitLoop; }
void setExitLoop(bool exit) { _shouldExitLoop = exit; }