[Scummvm-git-logs] scummvm master -> 1faf8628d050c9924950fe78ad08afae77db4cba
sluicebox
noreply at scummvm.org
Sat Aug 24 20:42:05 UTC 2024
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:
1faf8628d0 AGI: Fix init error handling
Commit: 1faf8628d050c9924950fe78ad08afae77db4cba
https://github.com/scummvm/scummvm/commit/1faf8628d050c9924950fe78ad08afae77db4cba
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-08-24T13:41:28-07:00
Commit Message:
AGI: Fix init error handling
Initialization errors were ignored, causing the launcher to behave as
if the engine ended normally.
Changed paths:
engines/agi/agi.cpp
engines/agi/agi.h
engines/agi/cycle.cpp
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index d5d1cf046c4..d36e23b149c 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -594,9 +594,9 @@ Common::Error AgiEngine::go() {
}
inGameTimerReset();
- runGame();
+ int ec = runGame();
- return Common::kNoError;
+ return (ec == errOK) ? Common::kNoError : Common::kUnknownError;
}
void AgiEngine::syncSoundSettings() {
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 759016d4a4b..a39d5708ddc 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -922,7 +922,7 @@ public:
void newRoom(int16 newRoomNr);
void resetControllers();
void interpretCycle();
- int playGame();
+ void playGame();
void allowSynthetic(bool);
void processScummVMEvents();
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index db7bf104af7..913e55b2911 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -316,8 +316,7 @@ uint16 AgiEngine::processAGIEvents() {
return key;
}
-int AgiEngine::playGame() {
- int ec = errOK;
+void AgiEngine::playGame() {
const AgiAppleIIgsDelayOverwriteGameEntry *appleIIgsDelayOverwrite = nullptr;
const AgiAppleIIgsDelayOverwriteRoomEntry *appleIIgsDelayRoomOverwrite = nullptr;
@@ -477,8 +476,6 @@ int AgiEngine::playGame() {
} while (!(shouldQuit() || _restartGame));
_sound->stopSound();
-
- return ec;
}
int AgiEngine::runGame() {
@@ -489,7 +486,8 @@ int AgiEngine::runGame() {
debugC(2, kDebugLevelMain, "game loop");
debugC(2, kDebugLevelMain, "game version = 0x%x", getVersion());
- if (agiInit() != errOK)
+ ec = agiInit();
+ if (ec != errOK)
break;
if (_restartGame) {
@@ -561,7 +559,7 @@ int AgiEngine::runGame() {
setVar(VM_VAR_MAX_INPUT_CHARACTERS, 38);
_text->promptDisable();
- ec = playGame();
+ playGame();
agiDeinit();
} while (_restartGame);
More information about the Scummvm-git-logs
mailing list