aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/dialogue.cpp8
-rw-r--r--engines/parallaction/exec_ns.cpp6
-rw-r--r--engines/parallaction/gui_br.cpp2
-rw-r--r--engines/parallaction/input.cpp2
-rw-r--r--engines/parallaction/parallaction.cpp12
-rw-r--r--engines/parallaction/parallaction.h1
-rw-r--r--engines/parallaction/parallaction_br.cpp10
-rw-r--r--engines/parallaction/parallaction_ns.cpp16
-rw-r--r--engines/parallaction/saveload.cpp8
9 files changed, 33 insertions, 32 deletions
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index b9dea60dc0..fe5b61b4ed 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -105,7 +105,7 @@ uint16 DialogueManager::askPassword() {
if (g_system->getEventManager()->pollEvent(e)) {
if (e.type == Common::EVENT_QUIT) {
- _engineFlags |= kEngineQuit;
+ _vm->_quit = true;
break;
}
@@ -230,7 +230,7 @@ void DialogueManager::run() {
displayQuestion();
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
return;
if (_q->_answers[0] == NULL) break;
@@ -239,7 +239,7 @@ void DialogueManager::run() {
if (!displayAnswers()) break;
answer = getAnswer();
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
return;
cmdlist = &_q->_answers[answer]->_commands;
@@ -272,7 +272,7 @@ int16 DialogueManager::selectAnswer() {
uint32 event;
Common::Point p;
- while (_engineFlags & kEngineQuit == 0) {
+ 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 bd2d54c0a0..32945d2204 100644
--- a/engines/parallaction/exec_ns.cpp
+++ b/engines/parallaction/exec_ns.cpp
@@ -297,7 +297,7 @@ DECLARE_COMMAND_OPCODE(drop){
DECLARE_COMMAND_OPCODE(quit) {
- _engineFlags |= kEngineQuit;
+ _vm->_quit = true;
}
@@ -427,7 +427,7 @@ void Parallaction::runCommands(CommandList& list, ZonePtr z) {
CommandPtr cmd = *it;
uint32 v8 = getLocationFlags();
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
break;
if (cmd->_flagsOn & kFlagsGlobal) {
@@ -519,7 +519,7 @@ uint16 Parallaction::runZone(ZonePtr z) {
case kZoneSpeak:
runDialogue(z->u.speak);
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
return 0;
break;
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index c515299a34..239c071058 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -50,7 +50,7 @@ void Parallaction_br::guiStart() {
int option = guiShowMenu();
switch (option) {
case kMenuQuit:
- _engineFlags |= kEngineQuit;
+ _vm->_quit = true;
break;
case kMenuLoadGame:
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index e758bbd41c..0fc00ce03b 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -80,7 +80,7 @@ uint16 Input::readInput() {
break;
case Common::EVENT_QUIT:
- _engineFlags |= kEngineQuit;
+ _vm->_quit = true;
return KeyDown;
default:
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 25ebe4263d..957a160c34 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -331,7 +331,7 @@ void Parallaction::processInput(InputData *data) {
break;
case kEvQuitGame:
- _engineFlags |= kEngineQuit;
+ _vm->_quit = true;
break;
case kEvSaveGame:
@@ -358,19 +358,19 @@ void Parallaction::runGame() {
processInput(data);
}
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
return;
runPendingZones();
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
return;
if (_engineFlags & kEngineChangeLocation) {
changeLocation(_location._name);
}
- if (_engineFlags & kEngineQuit)
+ if (_vm->_quit)
return;
_gfx->beginFrame();
@@ -466,7 +466,7 @@ ZonePtr Parallaction::findZone(const char *name) {
void Parallaction::freeZones() {
- debugC(2, kDebugExec, "freeZones: kEngineQuit = %i", _engineFlags & kEngineQuit);
+ debugC(2, kDebugExec, "freeZones: _vm->_quit = %i", _vm->_quit);
ZoneList::iterator it = _location._zones.begin();
@@ -475,7 +475,7 @@ void Parallaction::freeZones() {
// NOTE : this condition has been relaxed compared to the original, to allow the engine
// to retain special - needed - zones that were lost across location switches.
ZonePtr z = *it;
- if (((z->_top == -1) || (z->_left == -2)) && ((_engineFlags & kEngineQuit) == 0)) {
+ if (((z->_top == -1) || (z->_left == -2)) && ((_vm->_quit) == 0)) {
debugC(2, kDebugExec, "freeZones preserving zone '%s'", z->_name);
it++;
} else {
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 5ae1386378..dcb91aaa8f 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -98,7 +98,6 @@ enum {
};
enum EngineFlags {
- kEngineQuit = (1 << 0),
kEnginePauseJobs = (1 << 1),
kEngineInventory = (1 << 2),
kEngineWalking = (1 << 3),
diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp
index b22e1b0f2d..347457f680 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 ((_engineFlags & kEngineQuit) == 0) {
+ while (_vm->_quit == 0) {
guiStart();
- if (_engineFlags & kEngineQuit)
- return 0;
+ if (_vm->_quit)
+ return _rtl;
// initCharacter();
_input->_inputMode = Input::kInputModeGame;
- while ((_engineFlags & (kEngineReturn | kEngineQuit)) == 0) {
+ while (((_engineFlags & kEngineReturn) == 0) && (!_vm->_quit)) {
runGame();
}
_engineFlags &= ~kEngineReturn;
@@ -125,7 +125,7 @@ int Parallaction_br::go() {
}
- return 0;
+ return _rtl;
}
diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index f346a278f7..fb9e51ee26 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -236,20 +236,20 @@ int Parallaction_ns::go() {
guiStart();
- if (_engineFlags & kEngineQuit)
- return 0;
+ if (_vm->_quit)
+ return _rtl;
changeLocation(_location._name);
- if (_engineFlags & kEngineQuit)
- return 0;
+ if (_vm->_quit)
+ return _rtl;
_input->_inputMode = Input::kInputModeGame;
- while ((_engineFlags & kEngineQuit) == 0) {
+ while (!_vm->_quit) {
runGame();
}
- return 0;
+ return _rtl;
}
void Parallaction_ns::switchBackground(const char* background, const char* mask) {
@@ -454,13 +454,13 @@ void Parallaction_ns::cleanupGame() {
memset(_locationNames, 0, sizeof(_locationNames));
// this flag tells freeZones to unconditionally remove *all* Zones
- _engineFlags |= kEngineQuit;
+ _vm->_quit = true;
freeZones();
freeAnimations();
// this dangerous flag can now be cleared
- _engineFlags &= ~kEngineQuit;
+ _vm->_quit = false;
// main character animation is restored
_location._animations.push_front(_char._ani);
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp
index 002295315d..86700d6bb1 100644
--- a/engines/parallaction/saveload.cpp
+++ b/engines/parallaction/saveload.cpp
@@ -132,11 +132,13 @@ void Parallaction_ns::doLoadGame(uint16 slot) {
// TODO (LIST): unify (and parametrize) calls to freeZones.
// We aren't calling freeAnimations because it is not needed, since
// kChangeLocation will trigger a complete deletion. Anyway, we still
- // need to invoke freeZones here with kEngineQuit set, because the
+ // need to invoke freeZones here with _quit set, because the
// call in changeLocation preserve certain zones.
- _engineFlags |= kEngineQuit;
+ _quit = true;
+
freeZones();
- _engineFlags &= ~kEngineQuit;
+
+ _quit = false;
_numLocations = atoi(s);