aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--queen/journal.cpp4
-rw-r--r--queen/logic.cpp6
-rw-r--r--queen/queen.cpp3
-rw-r--r--queen/queen.h2
4 files changed, 10 insertions, 5 deletions
diff --git a/queen/journal.cpp b/queen/journal.cpp
index 5a72dbccf1..f1a32bd6a5 100644
--- a/queen/journal.cpp
+++ b/queen/journal.cpp
@@ -289,7 +289,9 @@ void Journal::handleYesNoMode(int16 zoneNum) {
}
break;
case ZN_GIVEUP:
- OSystem::instance()->quit();
+ _quit = true;
+ _quitCleanly = false;
+ _vm->quitGame();
break;
}
} else if (zoneNum == ZN_NO) {
diff --git a/queen/logic.cpp b/queen/logic.cpp
index 95e14a4883..711bb596fd 100644
--- a/queen/logic.cpp
+++ b/queen/logic.cpp
@@ -1529,7 +1529,7 @@ void Logic::asmEndGame() {
_vm->update();
}
debug(0, "Game completed.");
- OSystem::instance()->quit();
+ _vm->quitGame();
}
void Logic::asmPutCameraOnDino() {
@@ -1952,7 +1952,7 @@ void Logic::asmPanLeftToBomb() {
void Logic::asmEndDemo() {
debug(0, "Flight of the Amazon Queen, released January 95.");
- OSystem::instance()->quit();
+ _vm->quitGame();
}
void Logic::asmInterviewIntro() {
@@ -1997,7 +1997,7 @@ void Logic::asmInterviewIntro() {
void Logic::asmEndInterview() {
debug(0, "Interactive Interview copyright (c) 1995, IBI.");
- OSystem::instance()->quit();
+ _vm->quitGame();
}
void Logic::startCredits(const char *filename) {
diff --git a/queen/queen.cpp b/queen/queen.cpp
index f2f6cd9daf..79b63ed241 100644
--- a/queen/queen.cpp
+++ b/queen/queen.cpp
@@ -304,7 +304,8 @@ void QueenEngine::go() {
_logic->oldRoom(0);
_logic->newRoom(_logic->currentRoom());
- for (;;) {
+ _quit = false;
+ while (!_quit) {
// queen.c lines 4080-4104
if (_logic->newRoom() > 0) {
_logic->update();
diff --git a/queen/queen.h b/queen/queen.h
index ddc0933b10..7912f151ae 100644
--- a/queen/queen.h
+++ b/queen/queen.h
@@ -96,6 +96,7 @@ public:
void talkSpeed(int speed) { _talkSpeed = speed; }
bool subtitles() const { return _subtitles; }
void subtitles(bool enable) { _subtitles = enable; }
+ void quitGame() { _quit = true; }
void update(bool checkPlayerInput = false);
@@ -121,6 +122,7 @@ protected:
int _talkSpeed;
bool _subtitles;
+ bool _quit;
BamScene *_bam;
BankManager *_bankMan;