Ticket #3323: audiocdsave.diff
File audiocdsave.diff, 2.5 KB (added by , 17 years ago) |
---|
-
engines/scumm/sound.cpp
37 37 #include "common/util.h" 38 38 39 39 #include "sound/adpcm.h" 40 #include "sound/audiocd.h"41 40 #include "sound/flac.h" 42 41 #include "sound/mididrv.h" 43 42 #include "sound/mixer.h" -
engines/scumm/scumm.h
38 38 #include "scumm/detection.h" 39 39 #include "scumm/script.h" 40 40 41 #include "sound/audiocd.h" 41 42 #include "sound/mididrv.h" 42 43 43 44 namespace GUI { … … 608 609 uint32 _lastSaveTime; 609 610 bool _saveTemporaryState; 610 611 char _saveLoadName[32]; 612 Audio::AudioCDManager::Status _audioCDStatus; 611 613 612 614 bool saveState(int slot, bool compat); 613 615 bool loadState(int slot, bool compat); -
engines/scumm/saveload.cpp
43 43 #include "scumm/he/sprite_he.h" 44 44 #include "scumm/verbs.h" 45 45 46 #include "sound/audiocd.h"47 46 #include "sound/mixer.h" 48 47 49 48 namespace Scumm { … … 376 375 377 376 _sound->pauseSounds(false); 378 377 378 // If we are loading, and the music being loaded was supposed to loop 379 // forever, then resume playing it. This helps a lot when the audio CD 380 // is used to provide ambient music (see bug #788195). 381 if (_audioCDStatus.playing && _audioCDStatus.numLoops < 0) { 382 AudioCD.play(_audioCDStatus.track, _audioCDStatus.numLoops, _audioCDStatus.start, _audioCDStatus.duration); 383 } 384 379 385 return true; 380 386 } 381 387 … … 1131 1137 // Save/load the Audio CD status 1132 1138 // 1133 1139 if (s->getVersion() >= VER(24)) { 1134 Audio::AudioCDManager::Status info;1135 1140 if (s->isSaving()) 1136 info = AudioCD.getStatus(); 1137 s->saveLoadArrayOf(&info, 1, sizeof(info), audioCDEntries); 1138 // If we are loading, and the music being loaded was supposed to loop 1139 // forever, then resume playing it. This helps a lot when the audio CD 1140 // is used to provide ambient music (see bug #788195). 1141 if (s->isLoading() && info.playing && info.numLoops < 0) 1142 AudioCD.play(info.track, info.numLoops, info.start, info.duration); 1141 _audioCDStatus = AudioCD.getStatus(); 1142 s->saveLoadArrayOf(&_audioCDStatus, 1, sizeof(_audioCDStatus), audioCDEntries); 1143 // We may want to resume CD playing, but we can't do this until 1144 // all sounds have been unpaused (see bug #1756381). 1143 1145 } 1144 1146 1145 1147