aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine/savegame.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-02-15 14:16:02 +0100
committerWillem Jan Palenstijn2015-02-15 14:16:02 +0100
commit6dcc8b03b89902020f7a52f4823706bc8376e0b3 (patch)
tree2a1ee497bf0d031bbeb1ac249400046797ef8f9f /engines/sci/engine/savegame.cpp
parent7658821afd7a6d2e70286866c15eff7dd2618115 (diff)
parent2b49b5f95e8d6bd5ea3ab8ffb20ebad2ae7fc95e (diff)
downloadscummvm-rg350-6dcc8b03b89902020f7a52f4823706bc8376e0b3.tar.gz
scummvm-rg350-6dcc8b03b89902020f7a52f4823706bc8376e0b3.tar.bz2
scummvm-rg350-6dcc8b03b89902020f7a52f4823706bc8376e0b3.zip
Merge branch 'sci_audio'
This branch contains a number of improvements to how song priorities are handled. We are now much closer to how SSCI treats priority. It also increases the SCI savegame version from 31 to 33.
Diffstat (limited to 'engines/sci/engine/savegame.cpp')
-rw-r--r--engines/sci/engine/savegame.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 0b55425406..61f8058e45 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -617,6 +617,14 @@ void MusicEntry::saveLoadWithSerializer(Common::Serializer &s) {
s.syncAsSint32LE(fadeTicker);
s.syncAsSint32LE(fadeTickerStep);
s.syncAsByte(status);
+ if (s.getVersion() >= 32)
+ s.syncAsByte(playBed);
+ else if (s.isLoading())
+ playBed = false;
+ if (s.getVersion() >= 33)
+ s.syncAsByte(overridePriority);
+ else if (s.isLoading())
+ overridePriority = false;
// pMidiParser and pStreamAud will be initialized when the
// sound list is reconstructed in gamestate_restore()
@@ -635,8 +643,12 @@ void SoundCommandParser::syncPlayList(Common::Serializer &s) {
void SoundCommandParser::reconstructPlayList() {
Common::StackLock lock(_music->_mutex);
- const MusicList::iterator end = _music->getPlayListEnd();
- for (MusicList::iterator i = _music->getPlayListStart(); i != end; ++i) {
+ // We store all songs here because starting songs may re-shuffle their order
+ MusicList songs;
+ for (MusicList::iterator i = _music->getPlayListStart(); i != _music->getPlayListEnd(); ++i)
+ songs.push_back(*i);
+
+ for (MusicList::iterator i = songs.begin(); i != songs.end(); ++i) {
initSoundResource(*i);
if ((*i)->status == kSoundPlaying) {
@@ -650,7 +662,7 @@ void SoundCommandParser::reconstructPlayList() {
if (_soundVersion >= SCI_VERSION_1_EARLY)
writeSelectorValue(_segMan, (*i)->soundObj, SELECTOR(vol), (*i)->volume);
- processPlaySound((*i)->soundObj);
+ processPlaySound((*i)->soundObj, (*i)->playBed);
}
}
}