aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorChristopher Page2008-07-08 01:33:57 +0000
committerChristopher Page2008-07-08 01:33:57 +0000
commit3beccaf11591f4eef4a53993d656f1438f614a9c (patch)
tree67d7432703f64c877ebabfba25d72ed582b76291 /engines/agi
parenta43f016b94dd9214f0c72ae1f999a3a265977116 (diff)
downloadscummvm-rg350-3beccaf11591f4eef4a53993d656f1438f614a9c.tar.gz
scummvm-rg350-3beccaf11591f4eef4a53993d656f1438f614a9c.tar.bz2
scummvm-rg350-3beccaf11591f4eef4a53993d656f1438f614a9c.zip
PreAGI works with the new GMM implementation
svn-id: r32956
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/loader_v3.cpp3
-rw-r--r--engines/agi/preagi.cpp2
-rw-r--r--engines/agi/preagi_common.cpp4
-rw-r--r--engines/agi/preagi_mickey.cpp8
-rw-r--r--engines/agi/preagi_troll.cpp7
-rw-r--r--engines/agi/preagi_winnie.cpp9
6 files changed, 15 insertions, 18 deletions
diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index dcf7d83809..8c8c8da7fa 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -27,6 +27,7 @@
#include "agi/lzw.h"
#include "common/config-manager.h"
+#include "common/events.h"
#include "common/fs.h"
namespace Agi {
@@ -231,7 +232,7 @@ uint8 *AgiLoader_v3::loadVolRes(AgiDir *agid) {
debugC(3, kDebugLevelResources, "x = %x %x", x[0], x[1]);
error("ACK! BAD RESOURCE");
- g_system->quit();
+ g_system->getEventManager()->pushEvent(Common::EVENT_QUIT);
}
agid->len = READ_LE_UINT16((uint8 *) x + 3); /* uncompressed size */
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index f2301e012a..83d8e35aeb 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -228,7 +228,7 @@ FIXME (Fingolfin asks): Why are Mickey, Winnie and Troll standalone classes
error("Unknown preagi engine");
break;
}
- return 0;
+ return _eventMan->shouldRTL();
}
} // End of namespace Agi
diff --git a/engines/agi/preagi_common.cpp b/engines/agi/preagi_common.cpp
index 5d99dfa7f9..70490b66e7 100644
--- a/engines/agi/preagi_common.cpp
+++ b/engines/agi/preagi_common.cpp
@@ -122,11 +122,11 @@ void PreAgiEngine::printStrXOR(char *szMsg) {
int PreAgiEngine::getSelection(SelectionTypes type) {
Common::Event event;
- for (;;) {
+ while (!_eventMan->shouldQuit()) {
while (_eventMan->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- _system->quit();
+ return 0;
case Common::EVENT_RBUTTONUP:
return 0;
case Common::EVENT_LBUTTONUP:
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index 08f8969ca3..07f96a31bd 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -343,11 +343,11 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) {
drawMenu(menu, *sel0, *sel1);
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- exit(0);
+ return 0;
case Common::EVENT_MOUSEMOVE:
if (iRow < 2) {
x = event.mouse.x / 8;
@@ -641,7 +641,6 @@ void Mickey::playSound(ENUM_MSA_SOUND iSound) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- _vm->_system->quit();
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
case Common::EVENT_KEYDOWN:
@@ -2054,7 +2053,6 @@ void Mickey::waitAnyKey(bool anim) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- _vm->_system->quit();
case Common::EVENT_KEYDOWN:
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
@@ -2153,7 +2151,7 @@ void Mickey::run() {
intro();
// Game loop
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
drawRoom();
if (_game.fIntro) {
diff --git a/engines/agi/preagi_troll.cpp b/engines/agi/preagi_troll.cpp
index 7502c63c6c..f811cf421f 100644
--- a/engines/agi/preagi_troll.cpp
+++ b/engines/agi/preagi_troll.cpp
@@ -58,11 +58,11 @@ bool Troll::getMenuSel(const char *szMenu, int *iSel, int nSel) {
drawMenu(szMenu, *iSel);
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- _vm->_system->quit();
+ return 0;
case Common::EVENT_MOUSEMOVE:
y = event.mouse.y / 8;
@@ -206,7 +206,6 @@ void Troll::waitAnyKeyIntro() {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- _vm->_system->quit();
case Common::EVENT_LBUTTONUP:
case Common::EVENT_KEYDOWN:
return;
@@ -269,7 +268,7 @@ void Troll::tutorial() {
int iSel = 0;
//char szTreasure[16] = {0};
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
_vm->clearScreen(0xFF);
_vm->printStr(IDS_TRO_TUTORIAL_0);
diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp
index 87d13bff3d..827aad3ffe 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));
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
pc = startpc;
// check if block is to be run
@@ -797,12 +797,11 @@ void Winnie::getMenuSel(char *szMenu, int *iSel, int fCanSel[]) {
// Show the mouse cursor for the menu
CursorMan.showMouse(true);
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
while (_vm->_system->getEventManager()->pollEvent(event)) {
switch(event.type) {
case Common::EVENT_QUIT:
- _vm->_system->quit();
- break;
+ return;
case Common::EVENT_MOUSEMOVE:
x = event.mouse.x / 8;
y = event.mouse.y / 8;
@@ -1014,7 +1013,7 @@ phase2:
if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK)
goto phase1;
}
- for (;;) {
+ while (!_vm->_system->getEventManager()->shouldQuit()) {
for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) {
case IDI_WTP_PAR_GOTO: