[Scummvm-git-logs] scummvm master -> 319dcd9a89bff5a75e8eedf993cdde4da56a3bd0
sev-
noreply at scummvm.org
Sun Nov 12 00:33:44 UTC 2023
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:
319dcd9a89 SCUMM: Fix crash on engine startup
Commit: 319dcd9a89bff5a75e8eedf993cdde4da56a3bd0
https://github.com/scummvm/scummvm/commit/319dcd9a89bff5a75e8eedf993cdde4da56a3bd0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-11-12T01:33:39+01:00
Commit Message:
SCUMM: Fix crash on engine startup
If we show the "Audio files compressed with ScummVM Tools were detected"
message, we are in the middle of initialization. If a user tries to
launch the GMM while the message is still on, it will lead to a crash.
Changed paths:
engines/scumm/saveload.cpp
engines/scumm/scumm.cpp
engines/scumm/scumm.h
diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 177d5341e60..428fe2a0da9 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -79,6 +79,9 @@ Common::Error ScummEngine::loadGameState(int slot) {
}
bool ScummEngine::canLoadGameStateCurrently() {
+ if (!_setupIsComplete)
+ return false;
+
// FIXME: For now always allow loading in V0-V3 games
// FIXME: Actually, we might wish to support loading in more places.
// As long as we are sure it won't cause any problems... Are we
@@ -139,6 +142,9 @@ Common::Error ScummEngine::saveGameState(int slot, const Common::String &desc, b
}
bool ScummEngine::canSaveGameStateCurrently() {
+ if (!_setupIsComplete)
+ return false;
+
// Disallow saving in v0-v3 games when a 'prequel' to a cutscene is shown.
// This is a blank screen with text, and while this is shown, saving should
// be disabled, as no room is set.
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index e845c94da90..ae0d6849c1a 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1330,6 +1330,8 @@ Common::Error ScummEngine::init() {
if (!ConfMan.hasKey("talkspeed", _targetName))
setTalkSpeed(_defaultTextSpeed);
+ _setupIsComplete = true;
+
syncSoundSettings();
return Common::kNoError;
@@ -2259,6 +2261,9 @@ void ScummEngine::setupMusic(int midi, const Common::String &macInstrumentFile)
}
void ScummEngine::syncSoundSettings() {
+ if (!_setupIsComplete)
+ return;
+
if (isUsingOriginalGUI() && _game.version > 6) {
int guiTextStatus = 0;
if (ConfMan.getBool("speech_mute")) {
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 1ffa6698114..9fdcef43f54 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -892,6 +892,8 @@ protected:
int _mouseWheelFlag = 0; // For original save/load dialog only
+ bool _setupIsComplete = false;
+
/**
* Last time runInputScript was run (measured in terms of OSystem::getMillis()).
* This is currently only used for Indy3 mac to detect "double clicks".
More information about the Scummvm-git-logs
mailing list