aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/script.cpp
diff options
context:
space:
mode:
authorChristopher Page2008-07-07 22:34:45 +0000
committerChristopher Page2008-07-07 22:34:45 +0000
commita4f56de13ac2a7daaf5654c75f07ad6331f375e6 (patch)
tree8a000a805fef0d628eaeb9d662daf0649a785ffe /engines/agos/script.cpp
parentb50df858eb52520b529597d98fcd0d9b29619930 (diff)
downloadscummvm-rg350-a4f56de13ac2a7daaf5654c75f07ad6331f375e6.tar.gz
scummvm-rg350-a4f56de13ac2a7daaf5654c75f07ad6331f375e6.tar.bz2
scummvm-rg350-a4f56de13ac2a7daaf5654c75f07ad6331f375e6.zip
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
Diffstat (limited to 'engines/agos/script.cpp')
-rw-r--r--engines/agos/script.cpp9
1 files changed, 5 insertions, 4 deletions
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();