diff options
author | Christopher Page | 2008-07-10 23:03:34 +0000 |
---|---|---|
committer | Christopher Page | 2008-07-10 23:03:34 +0000 |
commit | 8d23846eafb9ec0c8998bdcc66cd646764917f8b (patch) | |
tree | fb08983555b9d5862c08fd7c685684624d5af372 /engines/parallaction | |
parent | 17ce8db211051bf0b7626958201b5bcfec206979 (diff) | |
download | scummvm-rg350-8d23846eafb9ec0c8998bdcc66cd646764917f8b.tar.gz scummvm-rg350-8d23846eafb9ec0c8998bdcc66cd646764917f8b.tar.bz2 scummvm-rg350-8d23846eafb9ec0c8998bdcc66cd646764917f8b.zip |
Parallaction works with the new GMM implementation
svn-id: r32997
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/dialogue.cpp | 11 | ||||
-rw-r--r-- | engines/parallaction/exec_ns.cpp | 7 | ||||
-rw-r--r-- | engines/parallaction/gui_br.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/input.cpp | 1 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 11 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 12 |
8 files changed, 32 insertions, 28 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp index fe5b61b4ed..eb2254cd80 100644 --- a/engines/parallaction/dialogue.cpp +++ b/engines/parallaction/dialogue.cpp @@ -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); diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index 32945d2204..0c4addd9b7 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -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; diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp index 239c071058..e073a7c989 100644 --- a/engines/parallaction/gui_br.cpp +++ b/engines/parallaction/gui_br.cpp @@ -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: diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp index 0fc00ce03b..096da1a3c5 100644 --- a/engines/parallaction/input.cpp +++ b/engines/parallaction/input.cpp @@ -80,7 +80,6 @@ uint16 Input::readInput() { break; case Common::EVENT_QUIT: - _vm->_quit = true; return KeyDown; default: diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 957a160c34..ee8e0cbcc8 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -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(); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index dcb91aaa8f..9f8bbea1b0 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -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; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index 347457f680..72a829d7cb 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -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(); } diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index fb9e51ee26..318443bb18 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -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) { |