diff options
author | Christopher Page | 2008-07-16 04:22:56 +0000 |
---|---|---|
committer | Christopher Page | 2008-07-16 04:22:56 +0000 |
commit | 7f480ac571f978802a3ecd5cf6169d0271d1f561 (patch) | |
tree | dcd550f0c84bec20aa3cfe5ffc4604a51f174ef6 /engines | |
parent | 7ecd54a9da6b9a14b4f16c3e53f87475d43bc2da (diff) | |
download | scummvm-rg350-7f480ac571f978802a3ecd5cf6169d0271d1f561.tar.gz scummvm-rg350-7f480ac571f978802a3ecd5cf6169d0271d1f561.tar.bz2 scummvm-rg350-7f480ac571f978802a3ecd5cf6169d0271d1f561.zip |
Quit and RTL code is more modular now. EVENT_RTL no longer sets _shouldQuit, shouldQuit is only set if there's an EVENT_QUIT. EVENT_RTL and EVENT_QUIT are completely separate from each other. Engine::quit() method now checks both _shouldQuit and _shouldRTL to determine if the engine should exit. There is no longer a need for resetQuit(), so it's removed
svn-id: r33082
Diffstat (limited to 'engines')
-rw-r--r-- | engines/agi/preagi_common.cpp | 1 | ||||
-rw-r--r-- | engines/agi/preagi_mickey.cpp | 3 | ||||
-rw-r--r-- | engines/agi/preagi_troll.cpp | 2 | ||||
-rw-r--r-- | engines/agi/preagi_winnie.cpp | 1 | ||||
-rw-r--r-- | engines/agos/event.cpp | 1 | ||||
-rw-r--r-- | engines/engine.h | 4 | ||||
-rw-r--r-- | engines/kyra/sequences_lok.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/text_lok.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/vqa.cpp | 1 | ||||
-rw-r--r-- | engines/lure/animseq.cpp | 2 | ||||
-rw-r--r-- | engines/lure/events.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/input.cpp | 2 | ||||
-rw-r--r-- | engines/queen/input.cpp | 2 | ||||
-rw-r--r-- | engines/queen/journal.cpp | 1 | ||||
-rw-r--r-- | engines/saga/introproc_ihnm.cpp | 1 | ||||
-rw-r--r-- | engines/sky/intro.cpp | 2 | ||||
-rw-r--r-- | engines/sword2/animation.cpp | 1 | ||||
-rw-r--r-- | engines/touche/menu.cpp | 2 |
18 files changed, 23 insertions, 7 deletions
diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp index 7817a7594f..3cd04351f7 100644 --- a/engines/agi/preagi_common.cpp +++ b/engines/agi/preagi_common.cpp @@ -123,6 +123,7 @@ int PreAgiEngine::getSelection(SelectionTypes type) { while (!quit()) { while (_eventMan->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: return 0; case Common::EVENT_RBUTTONUP: diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp index 6055d21197..5d89e96d59 100644 --- a/engines/agi/preagi_mickey.cpp +++ b/engines/agi/preagi_mickey.cpp @@ -345,6 +345,7 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) { while (!_vm->quit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: return 0; case Common::EVENT_MOUSEMOVE: @@ -639,6 +640,7 @@ void Mickey::playSound(ENUM_MSA_SOUND iSound) { if (iSound == IDI_MSA_SND_THEME) { while (_vm->_system->getEventManager()->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: @@ -2051,6 +2053,7 @@ void Mickey::waitAnyKey(bool anim) { for (;;) { while (_vm->_system->getEventManager()->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: case Common::EVENT_KEYDOWN: case Common::EVENT_LBUTTONUP: diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp index 418f174a94..beff721fda 100644 --- a/engines/agi/preagi_troll.cpp +++ b/engines/agi/preagi_troll.cpp @@ -59,6 +59,7 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) { while (!_vm->quit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: return 0; case Common::EVENT_MOUSEMOVE: @@ -203,6 +204,7 @@ void Troll::waitAnyKeyIntro() { for (;;) { while (_vm->_system->getEventManager()->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: case Common::EVENT_LBUTTONUP: case Common::EVENT_KEYDOWN: diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index bb0d375fc2..bf023fe5e5 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -799,6 +799,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) { while (!_vm->quit()) { while (_vm->_system->getEventManager()->pollEvent(event)) { switch(event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: return; case Common::EVENT_MOUSEMOVE: diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp index 5082db84be..4db3545594 100644 --- a/engines/agos/event.cpp +++ b/engines/agos/event.cpp @@ -520,6 +520,7 @@ void AGOSEngine::delay(uint amount) { setBitFlag(92, false); _rightButtonDown++; break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: return; default: diff --git a/engines/engine.h b/engines/engine.h index 0968642a08..278c259ea8 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -128,9 +128,9 @@ public: bool isPaused() const { return _pauseLevel != 0; } /** - * Return whether or not the engine should quit + * Return whether or not the ENGINE should quit */ - bool quit() const { return _eventMan->shouldQuit(); } + bool quit() const { return (_eventMan->shouldQuit() || _eventMan->shouldRTL()); } /** Run the Global Main Menu Dialog */ diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp index 577dcd827b..77cfbed2d0 100644 --- a/engines/kyra/sequences_lok.cpp +++ b/engines/kyra/sequences_lok.cpp @@ -1185,6 +1185,7 @@ void KyraEngine_LoK::seq_playCredits() { case Common::EVENT_KEYDOWN: finished = true; break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: finished = true; break; diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index d452109f91..150ec59a23 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -120,6 +120,7 @@ void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const if (event.kbd.keycode == '.') _skipFlag = true; break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: runLoop = false; break; diff --git a/engines/kyra/vqa.cpp b/engines/kyra/vqa.cpp index 9e2adfa71f..c55c573ea3 100644 --- a/engines/kyra/vqa.cpp +++ b/engines/kyra/vqa.cpp @@ -670,6 +670,7 @@ void VQAMovie::play() { if (event.kbd.ascii == 27) return; break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: return; default: diff --git a/engines/lure/animseq.cpp b/engines/lure/animseq.cpp index f33c3307be..3d5265c90f 100644 --- a/engines/lure/animseq.cpp +++ b/engines/lure/animseq.cpp @@ -49,7 +49,7 @@ AnimAbortType AnimationSequence::delay(uint32 milliseconds) { else return ABORT_NEXT_SCENE; } else if (events.type() == Common::EVENT_LBUTTONDOWN) return ABORT_NEXT_SCENE; - else if (events.type() == Common::EVENT_QUIT) + else if ((events.type() == Common::EVENT_QUIT) || (events.type() == Common::EVENT_RTL)) return ABORT_END_INTRO; } diff --git a/engines/lure/events.cpp b/engines/lure/events.cpp index ed1102e9b2..97da8bdb03 100644 --- a/engines/lure/events.cpp +++ b/engines/lure/events.cpp @@ -187,7 +187,7 @@ void Events::waitForPress() { bool keyButton = false; while (!keyButton) { while (pollEvent()) { - if (_event.type == Common::EVENT_QUIT) return; + if ((_event.type == Common::EVENT_QUIT) || (_event.type == Common::EVENT_RTL)) return; else if ((_event.type == Common::EVENT_KEYDOWN) && (_event.kbd.ascii != 0)) keyButton = true; else if ((_event.type == Common::EVENT_LBUTTONDOWN) || diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 9d5ff4ef80..e57b95678f 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -78,7 +78,7 @@ uint16 Input::readInput() { case Common::EVENT_MOUSEMOVE: _mousePos = e.mouse; break; - + case Common::EVENT_RTL: case Common::EVENT_QUIT: _vm->_quit = true; return KeyDown; diff --git a/engines/queen/input.cpp b/engines/queen/input.cpp index e7fcf84959..84e21fbcaa 100644 --- a/engines/queen/input.cpp +++ b/engines/queen/input.cpp @@ -118,7 +118,7 @@ void Input::delay(uint amount) { case Common::EVENT_RBUTTONDOWN: _mouseButton |= MOUSE_RBUTTON; break; - + case Common::EVENT_RTL: case Common::EVENT_QUIT: if (_cutawayRunning) _cutawayQuit = true; diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index c0bd3837c1..ead759cdb6 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -84,6 +84,7 @@ void Journal::use() { case Common::EVENT_WHEELDOWN: handleMouseWheel(1); break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: return; default: diff --git a/engines/saga/introproc_ihnm.cpp b/engines/saga/introproc_ihnm.cpp index 079b355826..aaa428ca53 100644 --- a/engines/saga/introproc_ihnm.cpp +++ b/engines/saga/introproc_ihnm.cpp @@ -148,6 +148,7 @@ bool Scene::checkKey() { while (_vm->_eventMan->pollEvent(event)) { switch (event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: res = true; break; diff --git a/engines/sky/intro.cpp b/engines/sky/intro.cpp index 51160924da..d7a94f6c2f 100644 --- a/engines/sky/intro.cpp +++ b/engines/sky/intro.cpp @@ -911,7 +911,7 @@ bool Intro::escDelay(uint32 msecs) { if (event.type == Common::EVENT_KEYDOWN) { if (event.kbd.keycode == Common::KEYCODE_ESCAPE) return false; - } else if (event.type == Common::EVENT_QUIT) { + } else if (event.type == Common::EVENT_QUIT || event.type == Common::EVENT_RTL) { return false; } } diff --git a/engines/sword2/animation.cpp b/engines/sword2/animation.cpp index 47b71f4a33..76f14851e7 100644 --- a/engines/sword2/animation.cpp +++ b/engines/sword2/animation.cpp @@ -357,6 +357,7 @@ bool MoviePlayer::userInterrupt() { case Common::EVENT_SCREEN_CHANGED: handleScreenChanged(); break; + case Common::EVENT_RTL: case Common::EVENT_QUIT: terminate = true; break; diff --git a/engines/touche/menu.cpp b/engines/touche/menu.cpp index c3c14c61d3..82490fca38 100644 --- a/engines/touche/menu.cpp +++ b/engines/touche/menu.cpp @@ -395,6 +395,7 @@ void ToucheEngine::handleOptions(int forceDisplay) { while (_eventMan->pollEvent(event)) { const Button *button = 0; switch (event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: menuData.quit = true; menuData.exit = true; @@ -556,6 +557,7 @@ int ToucheEngine::displayQuitDialog() { Common::Event event; while (_eventMan->pollEvent(event)) { switch (event.type) { + case Common::EVENT_RTL: case Common::EVENT_QUIT: quitLoop = true; ret = 1; |