Ticket #14618: foa-dialog-fix.txt

File foa-dialog-fix.txt, 1.9 KB (added by eriktorbjorn, 6 months ago)

Possible fix for the Dialog glitch

Line 
1diff --git a/engines/scumm/gfx_gui.cpp b/engines/scumm/gfx_gui.cpp
2index 1bbf967fac7..9bd759284db 100644
3--- a/engines/scumm/gfx_gui.cpp
4+++ b/engines/scumm/gfx_gui.cpp
5@@ -1787,7 +1787,11 @@ void ScummEngine::showMainMenu() {
6 if (VAR_PRE_SAVELOAD_SCRIPT != 0xFF)
7 runScript(VAR(VAR_PRE_SAVELOAD_SCRIPT), 0, 0, nullptr);
8
9+ bool oldSaveSound = _saveSound;
10+ bool oldSaveTemporaryState = _saveTemporaryState;
11+
12 _saveSound = 1;
13+ _saveTemporaryState = false;
14 _shakeTempSavedState = _shakeEnabled;
15 setShake(0);
16
17@@ -1961,6 +1965,9 @@ void ScummEngine::showMainMenu() {
18 }
19 }
20
21+ _saveSound = oldSaveSound;
22+ _saveTemporaryState = oldSaveTemporaryState;
23+
24 _mainMenuIsActive = false;
25
26 if (_game.version > 6)
27diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
28index 02fd0e8d77a..8cc7b505cb4 100644
29--- a/engines/scumm/saveload.cpp
30+++ b/engines/scumm/saveload.cpp
31@@ -687,18 +687,18 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
32 // If we don't have iMUSE at all we may as well stop the sounds. The previous
33 // default behavior here was to stopAllSounds on all state restores.
34
35- if (!_imuse || _saveSound || !_saveTemporaryState)
36+ if (!_imuse || _saveSound || !_saveTemporaryState) {
37 _sound->stopAllSounds();
38
39 #ifdef ENABLE_SCUMM_7_8
40- if (_imuseDigital) {
41- _imuseDigital->stopAllSounds();
42- }
43+ if (_imuseDigital) {
44+ _imuseDigital->stopAllSounds();
45+ }
46 #endif
47
48- _sound->stopCD();
49-
50- _sound->pauseSounds(true);
51+ _sound->stopCD();
52+ _sound->pauseSounds(true);
53+ }
54
55 closeRoom();
56
57@@ -866,9 +866,10 @@ bool ScummEngine::loadState(int slot, bool compat, Common::String &filename) {
58
59 debug(1, "State loaded from '%s'", filename.c_str());
60
61- _sound->pauseSounds(false);
62-
63- _sound->restoreAfterLoad();
64+ if (!_imuse || _saveSound || !_saveTemporaryState) {
65+ _sound->pauseSounds(false);
66+ _sound->restoreAfterLoad();
67+ }
68
69 return true;
70 }