[Scummvm-git-logs] scummvm master -> 9236d4c05fc1821417f96d2977f7eba0dd9e27f6
yuv422
yuv422 at users.noreply.github.com
Sat Aug 29 11:58:42 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9236d4c05f DRAGONS: Allow quitting from more places in the game.
Commit: 9236d4c05fc1821417f96d2977f7eba0dd9e27f6
https://github.com/scummvm/scummvm/commit/9236d4c05fc1821417f96d2977f7eba0dd9e27f6
Author: Eric Fry (yuv422 at users.noreply.github.com)
Date: 2020-08-29T21:57:39+10:00
Commit Message:
DRAGONS: Allow quitting from more places in the game.
Changed paths:
engines/dragons/actor.cpp
engines/dragons/dragons.cpp
engines/dragons/scriptopcodes.cpp
engines/dragons/talk.cpp
diff --git a/engines/dragons/actor.cpp b/engines/dragons/actor.cpp
index 8452bd82ce..91426cbcc3 100644
--- a/engines/dragons/actor.cpp
+++ b/engines/dragons/actor.cpp
@@ -495,7 +495,7 @@ void Actor::stopWalk() {
}
void Actor::waitUntilFlag4IsSet() {
- while (!isFlagSet(ACTOR_FLAG_4)) {
+ while (!isFlagSet(ACTOR_FLAG_4) && !Engine::shouldQuit()) {
getEngine()->waitForFrames(1);
}
}
@@ -505,7 +505,7 @@ void Actor::waitUntilFlag8IsSet() {
return;
}
- while (!(_flags & ACTOR_FLAG_8)) {
+ while (!(_flags & ACTOR_FLAG_8) && !Engine::shouldQuit()) {
getEngine()->waitForFrames(1);
}
}
@@ -782,7 +782,7 @@ bool Actor::actorSetSequenceAndWaitAllowSkip(uint16 newSequenceID) {
}
bool Actor::waitUntilFlag4IsSetAllowSkip() {
- while (!isFlagSet(ACTOR_FLAG_4)) {
+ while (!isFlagSet(ACTOR_FLAG_4) && !Engine::shouldQuit()) {
getEngine()->waitForFrames(1);
if (getEngine()->checkForActionButtonRelease()) {
return true;
@@ -814,7 +814,7 @@ void Actor::waitForWalkToFinish() {
DragonsEngine *vm = getEngine();
do {
vm->waitForFrames(1);
- } while (isFlagSet(ACTOR_FLAG_10));
+ } while (!Engine::shouldQuit() && isFlagSet(ACTOR_FLAG_10));
}
} // End of namespace Dragons
diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index 8130e5cd4b..29b2609929 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -262,10 +262,12 @@ Common::Error DragonsEngine::run() {
loadScene(0);
}
- _scene->draw();
- _screen->updateScreen();
+ if (!shouldQuit()) {
+ _scene->draw();
+ _screen->updateScreen();
- gameLoop();
+ gameLoop();
+ }
delete _scene;
delete _actorManager;
@@ -958,7 +960,7 @@ void DragonsEngine::engineFlag0x20UpdateFunction() {
}
void DragonsEngine::waitForFrames(uint16 numFrames) {
- for (uint16 i = 0; i < numFrames; i++) {
+ for (uint16 i = 0; i < numFrames && !Engine::shouldQuit(); i++) {
wait();
updateHandler();
@@ -1654,14 +1656,16 @@ void DragonsEngine::mainMenu() {
waitForFrames(1);
} while (!checkForActionButtonRelease() && !shouldQuit());
- if (curMenuItem == 0) {
- _screen->clearScreen();
- loadingScreen();
- startGame = true;
- } else if (curMenuItem == 1) {
- //TODO options menu
- } else if (curMenuItem == 2) {
- _strPlayer->playVideo("previews.str");
+ if (!shouldQuit()) {
+ if (curMenuItem == 0) {
+ _screen->clearScreen();
+ loadingScreen();
+ startGame = true;
+ } else if (curMenuItem == 1) {
+ //TODO options menu
+ } else if (curMenuItem == 2) {
+ _strPlayer->playVideo("previews.str");
+ }
}
} while (!shouldQuit() && !startGame);
diff --git a/engines/dragons/scriptopcodes.cpp b/engines/dragons/scriptopcodes.cpp
index 139761260f..1a6caa9642 100644
--- a/engines/dragons/scriptopcodes.cpp
+++ b/engines/dragons/scriptopcodes.cpp
@@ -201,7 +201,7 @@ void ScriptOpcodes::executeScriptLoop(ScriptOpCall &scriptOpCall) {
// execOpcode(scriptOpCall);
// }
//
- while (scriptOpCall._code < scriptOpCall._codeEnd && !(scriptOpCall._result & 1)) {
+ while (scriptOpCall._code < scriptOpCall._codeEnd && !(scriptOpCall._result & 1) && !_vm->shouldQuit()) {
if (_vm->isFlagSet(ENGINE_FLAG_100000)) {
return;
diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index d8f314bf27..b183dcef6f 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -416,7 +416,7 @@ uint8 Talk::conversation_related_maybe(uint16 *dialogText, uint16 x, uint16 y, u
goto LAB_80032e18;
}
uVar10 = 0; //TODO PressedThisFrameStart(0);
- } while ((uVar10 & 0xffff) == 0);
+ } while (!Engine::shouldQuit() && (uVar10 & 0xffff) == 0);
returnStatus = 2;
curDialogTextPtr = puVar18;
LAB_80032e18:
@@ -425,7 +425,8 @@ uint8 Talk::conversation_related_maybe(uint16 *dialogText, uint16 x, uint16 y, u
_vm->_fontManager->clearTextDialog((uint) _dat_8008e7e8_dialogBox_x1, (uint) _dat_8008e844_dialogBox_y1,
(uint) _dat_8008e848_dialogBox_x2, (uint) _dat_8008e874_dialogBox_y2);
}
- } while (!_vm->isUnkFlagSet(ENGINE_UNK1_FLAG_1) &&
+ } while (!Engine::shouldQuit() &&
+ !_vm->isUnkFlagSet(ENGINE_UNK1_FLAG_1) &&
(((!_vm->isFlagSet(ENGINE_FLAG_1000_SUBTITLES_DISABLED) || (param_7 != 0)) && (*curDialogTextPtr != 0))));
}
if (param_5 != 0) {
More information about the Scummvm-git-logs
mailing list