From a4f56de13ac2a7daaf5654c75f07ad6331f375e6 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Mon, 7 Jul 2008 22:34:45 +0000 Subject: Implemented Common::EventManager::pushEvent() to insert fake events into the event queue. Quit and RTL events have been added, and are now tracked by the DefaultEventManager using shouldQuit() and shouldRTL(). AGOS is working with this new implementation, other engines to follow. svn-id: r32952 --- engines/agos/script.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/agos/script.cpp') diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 6758aec511..da47d61891 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -28,6 +28,7 @@ #include "common/system.h" +#include "common/events.h" #include "agos/animation.h" #include "agos/agos.h" @@ -410,7 +411,7 @@ void AGOSEngine::o_msg() { void AGOSEngine::o_end() { // 68: exit interpreter - _quit = true; + _eventMan->pushEvent(Common::EVENT_QUIT); } void AGOSEngine::o_done() { @@ -965,7 +966,7 @@ void AGOSEngine::writeVariable(uint16 variable, uint16 contents) { int AGOSEngine::runScript() { bool flag; - if (_quit) + if (_eventMan->shouldQuit()) return 1; do { @@ -1010,7 +1011,7 @@ int AGOSEngine::runScript() { error("Invalid opcode '%d' encountered", _opcode); executeOpcode(_opcode); - } while (getScriptCondition() != flag && !getScriptReturn() && !_quit); + } while (getScriptCondition() != flag && !getScriptReturn() && !_eventMan->shouldQuit()); return getScriptReturn(); } @@ -1066,7 +1067,7 @@ void AGOSEngine::waitForSync(uint a) { _exitCutscene = false; _rightButtonDown = false; - while (_vgaWaitFor != 0 && !_quit) { + while (_vgaWaitFor != 0 && !_eventMan->shouldQuit()) { if (_rightButtonDown) { if (_vgaWaitFor == 200 && (getGameType() == GType_FF || !getBitFlag(14))) { skipSpeech(); -- cgit v1.2.3 From e808cdf7a08d641389ecc81063b3b1016c7bc8cf Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 9 Jul 2008 02:27:05 +0000 Subject: Reimplemented pushEvent() and artificialEventQueue to work with Events instead of EventTypes. Reimplemented Queue as a List instead of Array. Updated AGOS, AGI, CINE, GOB, and KYRA to work with the current implementation of the GMM svn-id: r32971 --- engines/agos/script.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/agos/script.cpp') diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index da47d61891..69a1944605 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -411,7 +411,7 @@ void AGOSEngine::o_msg() { void AGOSEngine::o_end() { // 68: exit interpreter - _eventMan->pushEvent(Common::EVENT_QUIT); + quitGame(); } void AGOSEngine::o_done() { @@ -966,7 +966,7 @@ void AGOSEngine::writeVariable(uint16 variable, uint16 contents) { int AGOSEngine::runScript() { bool flag; - if (_eventMan->shouldQuit()) + if (quit()) return 1; do { @@ -1011,7 +1011,7 @@ int AGOSEngine::runScript() { error("Invalid opcode '%d' encountered", _opcode); executeOpcode(_opcode); - } while (getScriptCondition() != flag && !getScriptReturn() && !_eventMan->shouldQuit()); + } while (getScriptCondition() != flag && !getScriptReturn() && !quit()); return getScriptReturn(); } @@ -1067,7 +1067,7 @@ void AGOSEngine::waitForSync(uint a) { _exitCutscene = false; _rightButtonDown = false; - while (_vgaWaitFor != 0 && !_eventMan->shouldQuit()) { + while (_vgaWaitFor != 0 && !quit()) { if (_rightButtonDown) { if (_vgaWaitFor == 200 && (getGameType() == GType_FF || !getBitFlag(14))) { skipSpeech(); -- cgit v1.2.3 From 30b1a62e810cfbe3246ebb9b94aa341ea3be5f7c Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Thu, 10 Jul 2008 05:15:19 +0000 Subject: Removed unnecessary #inlcudes svn-id: r32984 --- engines/agos/script.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'engines/agos/script.cpp') diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 69a1944605..a0151d7713 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -28,7 +28,6 @@ #include "common/system.h" -#include "common/events.h" #include "agos/animation.h" #include "agos/agos.h" -- cgit v1.2.3 From fd65ea311ae0f1ea0ddfe6c4daa7bbe1a79823f9 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 8 Aug 2008 02:18:17 +0000 Subject: Hopefully allow quiting at any stage AGOS engines games again. svn-id: r33693 --- engines/agos/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/agos/script.cpp') diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 6758aec511..fa132ec26f 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -1012,7 +1012,7 @@ int AGOSEngine::runScript() { executeOpcode(_opcode); } while (getScriptCondition() != flag && !getScriptReturn() && !_quit); - return getScriptReturn(); + return (_quit) ? 1 : getScriptReturn(); } Child *nextSub(Child *sub, int16 key) { -- cgit v1.2.3 From 8d8c46e36fade04d4452f0ce1fbdd3ee942ac898 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 13 Aug 2008 20:45:00 +0000 Subject: Cleanup: Got rid of _quit and _rtl variables in engine.h/.cpp which are not used anymore. Found some _quit flags in Agos and Gob and replaced with bool quit() where appropriate svn-id: r33848 --- engines/agos/script.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/agos/script.cpp') diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp index 2a2ddeeb86..39c172be62 100644 --- a/engines/agos/script.cpp +++ b/engines/agos/script.cpp @@ -1012,7 +1012,7 @@ int AGOSEngine::runScript() { executeOpcode(_opcode); } while (getScriptCondition() != flag && !getScriptReturn() && !quit()); - return (_quit) ? 1 : getScriptReturn(); + return (quit()) ? 1 : getScriptReturn(); } Child *nextSub(Child *sub, int16 key) { -- cgit v1.2.3