aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
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/agi
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/agi')
-rw-r--r--engines/agi/cycle.cpp6
-rw-r--r--engines/agi/loader_v3.cpp4
-rw-r--r--engines/agi/op_cmd.cpp8
-rw-r--r--engines/agi/op_test.cpp2
-rw-r--r--engines/agi/preagi_common.cpp2
-rw-r--r--engines/agi/preagi_mickey.cpp4
-rw-r--r--engines/agi/preagi_troll.cpp4
-rw-r--r--engines/agi/preagi_winnie.cpp6
-rw-r--r--engines/agi/saveload.cpp4
9 files changed, 20 insertions, 20 deletions
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index e12efb6a2e..361f9479bc 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -117,7 +117,7 @@ void AgiEngine::interpretCycle() {
oldSound = getflag(fSoundOn);
_game.exitAllLogics = false;
- while (runLogic(0) == 0 && !_eventMan->shouldQuit()) {
+ while (runLogic(0) == 0 && !quit()) {
_game.vars[vWordNotFound] = 0;
_game.vars[vBorderTouchObj] = 0;
_game.vars[vBorderCode] = 0;
@@ -354,10 +354,10 @@ int AgiEngine::playGame() {
_game.vars[vKey] = 0;
}
- if (_eventMan->shouldQuit() == 0xff)
+ if (quit() == 0xff)
ec = errRestartGame;
- } while (_eventMan->shouldQuit() == 0);
+ } while (quit() == 0);
_sound->stopSound();
diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index 8c8c8da7fa..1432d35799 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -231,8 +231,8 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
debugC(3, kDebugLevelResources, "offset = %d", agid->offset);
debugC(3, kDebugLevelResources, "x = %x %x", x[0], x[1]);
error("ACK! BAD RESOURCE");
-
- g_system->getEventManager()->pushEvent(Common::EVENT_QUIT);
+
+ _vm->quitGame();
}
agid->len = READ_LE_UINT16((uint8 *) x + 3); /* uncompressed size */
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 0cd633b078..16d2a240dc 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1215,11 +1215,11 @@ cmd(quit) {
g_sound->stopSound();
if (p0) {
- g_system->getEventManager()->pushEvent(Common::EVENT_QUIT);
+ g_agi->quitGame();
} else {
if (g_agi->selectionBox
(" Quit the game, or continue? \n\n\n", buttons) == 0) {
- g_system->getEventManager()->pushEvent(Common::EVENT_QUIT);
+ g_agi->quitGame();
}
}
}
@@ -1233,7 +1233,7 @@ cmd(restart_game) {
g_agi->selectionBox(" Restart game, or continue? \n\n\n", buttons);
if (sel == 0) {
- g_system->getEventManager()->pushEvent(Common::EVENT_QUIT);
+ g_agi->quitGame();
g_agi->setflag(fRestartGame, true);
g_agi->_menu->enableAll();
}
@@ -1741,7 +1741,7 @@ int AgiEngine::runLogic(int n) {
curLogic->cIP = curLogic->sIP;
timerHack = 0;
- while (ip < _game.logics[n].size && !_eventMan->shouldQuit()) {
+ while (ip < _game.logics[n].size && !quit()) {
if (_debug.enabled) {
if (_debug.steps > 0) {
if (_debug.logic0 || n) {
diff --git a/engines/agi/op_test.cpp b/engines/agi/op_test.cpp
index 32fc2d89db..e1c2060df7 100644
--- a/engines/agi/op_test.cpp
+++ b/engines/agi/op_test.cpp
@@ -233,7 +233,7 @@ int AgiEngine::testIfCode(int lognum) {
uint8 p[16] = { 0 };
bool end_test = false;
- while (retval && !_eventMan->shouldQuit() && !end_test) {
+ while (retval && !quit() && !end_test) {
if (_debug.enabled && (_debug.logic0 || lognum))
debugConsole(lognum, lTEST_MODE, NULL);
diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp
index 70490b66e7..df933996ca 100644
--- a/engines/agi/preagi_common.cpp
+++ b/engines/agi/preagi_common.cpp
@@ -122,7 +122,7 @@ void PreAgiEngine::printStrXOR(char *szMsg) {
int PreAgiEngine::getSelection(SelectionTypes type) {
Common::Event event;
- while (!_eventMan->shouldQuit()) {
+ while (!quit()) {
while (_eventMan->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 07f96a31bd..fea78ed654 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -343,7 +343,7 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) {
drawMenu(menu, *sel0, *sel1);
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
@@ -2151,7 +2151,7 @@ void Mickey::run() {
intro();
// Game loop
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
drawRoom();
if (_game.fIntro) {
diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp
index f811cf421f..07bd1068dc 100644
--- a/engines/agi/preagi_troll.cpp
+++ b/engines/agi/preagi_troll.cpp
@@ -58,7 +58,7 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) {
drawMenu(szMenu, *iSel);
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
@@ -268,7 +268,7 @@ void Troll::tutorial() {
int iSel = 0;
//char szTreasure[16] = {0};
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
_vm->clearScreen(0xFF);
_vm->printStr(IDS_TRO_TUTORIAL_0);
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index 827aad3ffe..ac8c8939a4 100644
--- a/engines/agi/preagi_winnie.cpp
+++ b/engines/agi/preagi_winnie.cpp
@@ -241,7 +241,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) {
// extract header from buffer
parseRoomHeader(&hdr, buffer, sizeof(WTP_ROOM_HDR));
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
pc = startpc;
// check if block is to be run
@@ -797,7 +797,7 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
// Show the mouse cursor for the menu
CursorMan.showMouse(true);
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
@@ -1013,7 +1013,7 @@ phase2:
if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK)
goto phase1;
}
- while (!_vm->_system->getEventManager()->shouldQuit()) {
+ while (!_vm->quit()) {
for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) {
case IDI_WTP_PAR_GOTO:
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp
index 26d903d52a..4ea80479dc 100644
--- a/engines/agi/saveload.cpp
+++ b/engines/agi/saveload.cpp
@@ -92,7 +92,7 @@ int AgiEngine::saveGame(const char *fileName, const char *description) {
out->writeSint16BE((int16)_game.lognum);
out->writeSint16BE((int16)_game.playerControl);
- out->writeSint16BE((int16)_eventMan->shouldQuit());
+ out->writeSint16BE((int16)quit());
out->writeSint16BE((int16)_game.statusLine);
out->writeSint16BE((int16)_game.clockEnabled);
out->writeSint16BE((int16)_game.exitAllLogics);
@@ -283,7 +283,7 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) {
_game.playerControl = in->readSint16BE();
if (in->readSint16BE())
- _eventMan->pushEvent(Common::EVENT_QUIT);
+ quitGame();
_game.statusLine = in->readSint16BE();
_game.clockEnabled = in->readSint16BE();
_game.exitAllLogics = in->readSint16BE();