aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorChristopher Page2008-07-09 02:27:05 +0000
committerChristopher Page2008-07-09 02:27:05 +0000
commite808cdf7a08d641389ecc81063b3b1016c7bc8cf (patch)
treedd21fa0f4b624d426675820b318aa3e41707c3ca /engines/agos
parentb8fe71e7a12e60f0c19fa86da83f270dc09e14fd (diff)
downloadscummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.tar.gz
scummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.tar.bz2
scummvm-rg350-e808cdf7a08d641389ecc81063b3b1016c7bc8cf.zip
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
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp6
-rw-r--r--engines/agos/event.cpp4
-rw-r--r--engines/agos/gfx.cpp2
-rw-r--r--engines/agos/input.cpp4
-rw-r--r--engines/agos/script.cpp8
-rw-r--r--engines/agos/script_e1.cpp4
-rw-r--r--engines/agos/script_s1.cpp4
7 files changed, 16 insertions, 16 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 86121f89a6..a6e559726a 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -947,7 +947,7 @@ void AGOSEngine::pauseEngineIntern(bool pauseIt) {
void AGOSEngine::pause() {
pauseEngine(true);
- while (_pause && !_eventMan->shouldQuit()) {
+ while (_pause && !quit()) {
delay(1);
if (_keyPressed.keycode == Common::KEYCODE_p)
pauseEngine(false);
@@ -984,7 +984,7 @@ int AGOSEngine::go() {
(getFeatures() & GF_DEMO)) {
int i;
- while (!_eventMan->shouldQuit()) {
+ while (!quit()) {
for (i = 0; i < 4; i++) {
setWindowImage(3, 9902 + i);
debug(0, "Displaying image %d", 9902 + i);
@@ -1013,7 +1013,7 @@ int AGOSEngine::go() {
runSubroutine101();
permitInput();
- while (!_eventMan->shouldQuit()) {
+ while (!quit()) {
waitForInput();
handleVerbClicked(_verbHitArea);
delay(100);
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 4a362d420a..5082db84be 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -142,7 +142,7 @@ bool AGOSEngine::kickoffTimeEvents() {
cur_time = getTime() - _gameStoppedClock;
- while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !_eventMan->shouldQuit()) {
+ while ((te = _firstTimeStruct) != NULL && te->time <= cur_time && !quit()) {
result = true;
_pendingDeleteTimeEvent = te;
invokeTimeEvent(te);
@@ -543,7 +543,7 @@ void AGOSEngine::delay(uint amount) {
_system->delayMillis(this_delay);
cur = _system->getMillis();
- } while (cur < start + amount && !_eventMan->shouldQuit());
+ } while (cur < start + amount && !quit());
}
void AGOSEngine::timer_callback() {
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index e39b7c9ea4..bc8457aef9 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -1264,7 +1264,7 @@ void AGOSEngine::setWindowImageEx(uint16 mode, uint16 vga_res) {
if (getGameType() == GType_WW && (mode == 6 || mode == 8 || mode == 9)) {
setWindowImage(mode, vga_res);
} else {
- while (_copyScnFlag && !_eventMan->shouldQuit())
+ while (_copyScnFlag && !quit())
delay(1);
setWindowImage(mode, vga_res);
diff --git a/engines/agos/input.cpp b/engines/agos/input.cpp
index b3acfe188b..e9d64589b8 100644
--- a/engines/agos/input.cpp
+++ b/engines/agos/input.cpp
@@ -190,12 +190,12 @@ void AGOSEngine::waitForInput() {
resetVerbs();
}
- while (!_eventMan->shouldQuit()) {
+ while (!quit()) {
_lastHitArea = NULL;
_lastHitArea3 = NULL;
_dragAccept = 1;
- while (!_eventMan->shouldQuit()) {
+ while (!quit()) {
if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
_keyPressed.keycode == Common::KEYCODE_F10)
displayBoxStars();
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();
diff --git a/engines/agos/script_e1.cpp b/engines/agos/script_e1.cpp
index e394779ab8..97019800b1 100644
--- a/engines/agos/script_e1.cpp
+++ b/engines/agos/script_e1.cpp
@@ -565,7 +565,7 @@ void AGOSEngine_Elvira1::oe1_look() {
lobjFunc(l, "You can see "); /* Show objects */
}
if (r && (r->flags & 4) && levelOf(i) < 10000) {
- _eventMan->pushEvent(Common::EVENT_QUIT);
+ quitGame();
}
}
@@ -944,7 +944,7 @@ restart:
windowPutChar(window, *message2);
if (confirmYesOrNo(120, 62) == 0x7FFF) {
- _eventMan->pushEvent(Common::EVENT_QUIT);
+ quitGame();
} else {
goto restart;
}
diff --git a/engines/agos/script_s1.cpp b/engines/agos/script_s1.cpp
index e8577d21bc..5a26550847 100644
--- a/engines/agos/script_s1.cpp
+++ b/engines/agos/script_s1.cpp
@@ -345,14 +345,14 @@ void AGOSEngine_Simon1::os1_pauseGame() {
if (isSmartphone()) {
if (_keyPressed.keycode) {
if (_keyPressed.keycode == Common::KEYCODE_RETURN)
- _eventMan->pushEvent(Common::EVENT_QUIT);
+ quitGame();
else
break;
}
}
#endif
if (_keyPressed.keycode == keyYes)
- _eventMan->pushEvent(Common::EVENT_QUIT);
+ quitGame();
else if (_keyPressed.keycode == keyNo)
break;
}