PreAGI works with the new GMM implementation
svn-id: r32956
This commit is contained in:
parent
a43f016b94
commit
3beccaf115
6 changed files with 15 additions and 18 deletions
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue