Parallaction works with the new GMM implementation

svn-id: r32997
This commit is contained in:
Christopher Page 2008-07-10 23:03:34 +00:00
parent 17ce8db211
commit 8d23846eaf
8 changed files with 32 additions and 28 deletions

View File

@ -104,11 +104,6 @@ uint16 DialogueManager::askPassword() {
e.kbd.ascii = 0;
if (g_system->getEventManager()->pollEvent(e)) {
if (e.type == Common::EVENT_QUIT) {
_vm->_quit = true;
break;
}
if ((e.type == Common::EVENT_KEYDOWN) && isdigit(e.kbd.ascii)) {
_password[passwordLen] = e.kbd.ascii;
passwordLen++;
@ -230,7 +225,7 @@ void DialogueManager::run() {
displayQuestion();
if (_vm->_quit)
if (_vm->quit())
return;
if (_q->_answers[0] == NULL) break;
@ -239,7 +234,7 @@ void DialogueManager::run() {
if (!displayAnswers()) break;
answer = getAnswer();
if (_vm->_quit)
if (_vm->quit())
return;
cmdlist = &_q->_answers[answer]->_commands;
@ -272,7 +267,7 @@ int16 DialogueManager::selectAnswer() {
uint32 event;
Common::Point p;
while (!_vm->_quit) {
while (!_vm->quit()) {
_vm->_input->readInput();
_vm->_input->getCursorPos(p);

View File

@ -297,7 +297,8 @@ DECLARE_COMMAND_OPCODE(drop){
DECLARE_COMMAND_OPCODE(quit) {
_vm->_quit = true;
_quit = true;
_vm->quitGame();
}
@ -427,7 +428,7 @@ void Parallaction::runCommands(CommandList& list, ZonePtr z) {
CommandPtr cmd = *it;
uint32 v8 = getLocationFlags();
if (_vm->_quit)
if (_vm->quit())
break;
if (cmd->_flagsOn & kFlagsGlobal) {
@ -519,7 +520,7 @@ uint16 Parallaction::runZone(ZonePtr z) {
case kZoneSpeak:
runDialogue(z->u.speak);
if (_vm->_quit)
if (_vm->quit())
return 0;
break;

View File

@ -50,7 +50,8 @@ void Parallaction_br::guiStart() {
int option = guiShowMenu();
switch (option) {
case kMenuQuit:
_vm->_quit = true;
_quit = true;
_vm->quitGame();
break;
case kMenuLoadGame:

View File

@ -80,7 +80,6 @@ uint16 Input::readInput() {
break;
case Common::EVENT_QUIT:
_vm->_quit = true;
return KeyDown;
default:

View File

@ -118,6 +118,8 @@ int Parallaction::init() {
_location._comment = NULL;
_location._endComment = NULL;
_quit = false;
_pathBuffer = 0;
_screenSize = _screenWidth * _screenHeight;
@ -331,7 +333,8 @@ void Parallaction::processInput(InputData *data) {
break;
case kEvQuitGame:
_vm->_quit = true;
_quit = true;
_vm->quitGame();
break;
case kEvSaveGame:
@ -358,19 +361,19 @@ void Parallaction::runGame() {
processInput(data);
}
if (_vm->_quit)
if (_vm->quit())
return;
runPendingZones();
if (_vm->_quit)
if (_vm->quit())
return;
if (_engineFlags & kEngineChangeLocation) {
changeLocation(_location._name);
}
if (_vm->_quit)
if (_vm->quit())
return;
_gfx->beginFrame();

View File

@ -256,6 +256,11 @@ public:
virtual bool loadGame() = 0;
virtual bool saveGame() = 0;
bool _quit; /* The only reason this flag exists is for freeZones() to properly
* delete all zones when necessary. THIS FLAG IS NOT THE ENGINE QUIT FLAG,
* use _eventMan->shouldQuit() for that.
*/
Input *_input;
OpcodeSet _commandOpcodes;

View File

@ -105,17 +105,17 @@ int Parallaction_br::go() {
guiSplash("dyna");
guiSplash("core");
while (_vm->_quit == 0) {
while (quit() == 0) {
guiStart();
if (_vm->_quit)
return _rtl;
if (quit())
return _eventMan->shouldRTL();
// initCharacter();
_input->_inputMode = Input::kInputModeGame;
while (((_engineFlags & kEngineReturn) == 0) && (!_vm->_quit)) {
while (((_engineFlags & kEngineReturn) == 0) && (!quit())) {
runGame();
}
_engineFlags &= ~kEngineReturn;
@ -125,7 +125,7 @@ int Parallaction_br::go() {
}
return _rtl;
return _eventMan->shouldRTL();
}

View File

@ -236,20 +236,20 @@ int Parallaction_ns::go() {
guiStart();
if (_vm->_quit)
return _rtl;
if (quit())
return _eventMan->shouldRTL();
changeLocation(_location._name);
if (_vm->_quit)
return _rtl;
if (quit())
return _eventMan->shouldRTL();
_input->_inputMode = Input::kInputModeGame;
while (!_vm->_quit) {
while (!quit()) {
runGame();
}
return _rtl;
return _eventMan->shouldRTL();
}
void Parallaction_ns::switchBackground(const char* background, const char* mask) {