[Scummvm-cvs-logs] SF.net SVN: scummvm: [33082] scummvm/branches/gsoc2008-rtl
cpage88 at users.sourceforge.net
cpage88 at users.sourceforge.net
Wed Jul 16 06:22:56 CEST 2008
Revision: 33082
http://scummvm.svn.sourceforge.net/scummvm/?rev=33082&view=rev
Author: cpage88
Date: 2008-07-15 21:22:56 -0700 (Tue, 15 Jul 2008)
Log Message:
-----------
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
Modified Paths:
--------------
scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h
scummvm/branches/gsoc2008-rtl/base/main.cpp
scummvm/branches/gsoc2008-rtl/common/events.h
scummvm/branches/gsoc2008-rtl/engines/agi/preagi_common.cpp
scummvm/branches/gsoc2008-rtl/engines/agi/preagi_mickey.cpp
scummvm/branches/gsoc2008-rtl/engines/agi/preagi_troll.cpp
scummvm/branches/gsoc2008-rtl/engines/agi/preagi_winnie.cpp
scummvm/branches/gsoc2008-rtl/engines/agos/event.cpp
scummvm/branches/gsoc2008-rtl/engines/engine.h
scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/text_lok.cpp
scummvm/branches/gsoc2008-rtl/engines/kyra/vqa.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp
scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp
scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp
scummvm/branches/gsoc2008-rtl/engines/queen/input.cpp
scummvm/branches/gsoc2008-rtl/engines/queen/journal.cpp
scummvm/branches/gsoc2008-rtl/engines/saga/introproc_ihnm.cpp
scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp
scummvm/branches/gsoc2008-rtl/engines/sword2/animation.cpp
scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp
Modified: scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -435,13 +435,15 @@
case Common::EVENT_MAINMENU:
if (g_engine && !g_engine->isPaused())
g_engine->mainMenuDialog();
+
if (_shouldQuit)
event.type = Common::EVENT_QUIT;
+ else if (_shouldRTL)
+ event.type = Common::EVENT_RTL;
break;
case Common::EVENT_RTL:
_shouldRTL = true;
- _shouldQuit = true;
break;
case Common::EVENT_QUIT:
Modified: scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/backends/events/default/default-events.h 2008-07-16 04:22:56 UTC (rev 33082)
@@ -117,7 +117,6 @@
virtual int getModifierState() const { return _modifierState; }
virtual int shouldQuit() const { return _shouldQuit; }
virtual int shouldRTL() const { return _shouldRTL; }
- virtual void resetQuit() { _shouldQuit = false; }
virtual void resetRTL() { _shouldRTL = false; }
};
Modified: scummvm/branches/gsoc2008-rtl/base/main.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/base/main.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/base/main.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -317,9 +317,8 @@
// (so instead of just quitting, show a nice error dialog to the
// user and let him pick another game).
- // Reset RTL and Quit flags in case we want to load another engine
+ // Reset RTL flag in case we want to load another engine
g_system->getEventManager()->resetRTL();
- g_system->getEventManager()->resetQuit();
if (result == 0)
break;
Modified: scummvm/branches/gsoc2008-rtl/common/events.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/common/events.h 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/common/events.h 2008-07-16 04:22:56 UTC (rev 33082)
@@ -181,12 +181,6 @@
virtual int shouldRTL() const = 0;
/**
- * We have returned to the launcher, and _shouldQuit should be reset to false
- */
-
- virtual void resetQuit() = 0;
-
- /**
* We have returned to the launcher, and the _shouldRTL should be reset to false
*/
virtual void resetRTL() = 0;
Modified: scummvm/branches/gsoc2008-rtl/engines/agi/preagi_common.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agi/preagi_common.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/agi/preagi_common.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -123,6 +123,7 @@
while (!quit()) {
while (_eventMan->pollEvent(event)) {
switch(event.type) {
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
return 0;
case Common::EVENT_RBUTTONUP:
Modified: scummvm/branches/gsoc2008-rtl/engines/agi/preagi_mickey.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agi/preagi_mickey.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/agi/preagi_mickey.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -345,6 +345,7 @@
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 @@
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 @@
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:
Modified: scummvm/branches/gsoc2008-rtl/engines/agi/preagi_troll.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agi/preagi_troll.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/agi/preagi_troll.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -59,6 +59,7 @@
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 @@
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:
Modified: scummvm/branches/gsoc2008-rtl/engines/agi/preagi_winnie.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agi/preagi_winnie.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/agi/preagi_winnie.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -799,6 +799,7 @@
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:
Modified: scummvm/branches/gsoc2008-rtl/engines/agos/event.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/agos/event.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/agos/event.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -520,6 +520,7 @@
setBitFlag(92, false);
_rightButtonDown++;
break;
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
return;
default:
Modified: scummvm/branches/gsoc2008-rtl/engines/engine.h
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/engine.h 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/engine.h 2008-07-16 04:22:56 UTC (rev 33082)
@@ -128,9 +128,9 @@
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
*/
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/sequences_lok.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -1185,6 +1185,7 @@
case Common::EVENT_KEYDOWN:
finished = true;
break;
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
finished = true;
break;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/text_lok.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/text_lok.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/text_lok.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -120,6 +120,7 @@
if (event.kbd.keycode == '.')
_skipFlag = true;
break;
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
runLoop = false;
break;
Modified: scummvm/branches/gsoc2008-rtl/engines/kyra/vqa.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/kyra/vqa.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/kyra/vqa.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -670,6 +670,7 @@
if (event.kbd.ascii == 27)
return;
break;
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
return;
default:
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/animseq.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -49,7 +49,7 @@
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;
}
Modified: scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/lure/events.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -187,7 +187,7 @@
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) ||
Modified: scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/parallaction/input.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -78,7 +78,7 @@
case Common::EVENT_MOUSEMOVE:
_mousePos = e.mouse;
break;
-
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
_vm->_quit = true;
return KeyDown;
Modified: scummvm/branches/gsoc2008-rtl/engines/queen/input.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/queen/input.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/queen/input.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -118,7 +118,7 @@
case Common::EVENT_RBUTTONDOWN:
_mouseButton |= MOUSE_RBUTTON;
break;
-
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
if (_cutawayRunning)
_cutawayQuit = true;
Modified: scummvm/branches/gsoc2008-rtl/engines/queen/journal.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/queen/journal.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/queen/journal.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -84,6 +84,7 @@
case Common::EVENT_WHEELDOWN:
handleMouseWheel(1);
break;
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
return;
default:
Modified: scummvm/branches/gsoc2008-rtl/engines/saga/introproc_ihnm.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/saga/introproc_ihnm.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/saga/introproc_ihnm.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -148,6 +148,7 @@
while (_vm->_eventMan->pollEvent(event)) {
switch (event.type) {
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
res = true;
break;
Modified: scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/sky/intro.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -911,7 +911,7 @@
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;
}
}
Modified: scummvm/branches/gsoc2008-rtl/engines/sword2/animation.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/sword2/animation.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/sword2/animation.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -357,6 +357,7 @@
case Common::EVENT_SCREEN_CHANGED:
handleScreenChanged();
break;
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
terminate = true;
break;
Modified: scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp
===================================================================
--- scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp 2008-07-15 22:54:39 UTC (rev 33081)
+++ scummvm/branches/gsoc2008-rtl/engines/touche/menu.cpp 2008-07-16 04:22:56 UTC (rev 33082)
@@ -395,6 +395,7 @@
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 @@
Common::Event event;
while (_eventMan->pollEvent(event)) {
switch (event.type) {
+ case Common::EVENT_RTL:
case Common::EVENT_QUIT:
quitLoop = true;
ret = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list