aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/imuse/imuse.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2012-11-16 07:49:17 +0100
committerTorbjörn Andersson2012-11-16 07:49:17 +0100
commitf0c1d8dcc46b77895ad85b3cdaaf3b81e497b0d8 (patch)
treebcc42017f70a4a8d74fe42e57ec6fb86b70795af /engines/scumm/imuse/imuse.cpp
parentf784d683e0f42c059331b49dbf90f91ac442b820 (diff)
downloadscummvm-rg350-f0c1d8dcc46b77895ad85b3cdaaf3b81e497b0d8.tar.gz
scummvm-rg350-f0c1d8dcc46b77895ad85b3cdaaf3b81e497b0d8.tar.bz2
scummvm-rg350-f0c1d8dcc46b77895ad85b3cdaaf3b81e497b0d8.zip
SCUMM: Add hack to preserve savegame compatibility with Mac MI1
For old savegames, we now use a "dummy" iMUSE objet to skip the old iMUSE save state. I had hoped to be able to do this without making any changes to the iMUSE code itself, but I was unable to. Also added note about how the save state for the new music will not quite work if the mixer output rate changes. Personally, I'm not too worried about that. It breaks, but it shouldn't break badly.
Diffstat (limited to 'engines/scumm/imuse/imuse.cpp')
-rw-r--r--engines/scumm/imuse/imuse.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/scumm/imuse/imuse.cpp b/engines/scumm/imuse/imuse.cpp
index 016ba89e7b..b69ce552bc 100644
--- a/engines/scumm/imuse/imuse.cpp
+++ b/engines/scumm/imuse/imuse.cpp
@@ -363,7 +363,7 @@ void IMuseInternal::pause(bool paused) {
_paused = paused;
}
-int IMuseInternal::save_or_load(Serializer *ser, ScummEngine *scumm) {
+int IMuseInternal::save_or_load(Serializer *ser, ScummEngine *scumm, bool fixAfterLoad) {
Common::StackLock lock(_mutex, "IMuseInternal::save_or_load()");
const SaveLoadEntry mainEntries[] = {
MKLINE(IMuseInternal, _queue_end, sleUint8, VER(8)),
@@ -440,7 +440,16 @@ int IMuseInternal::save_or_load(Serializer *ser, ScummEngine *scumm) {
for (i = 0; i < 8; ++i)
ser->saveLoadEntries(0, volumeFaderEntries);
- if (ser->isLoading()) {
+ // Normally, we have to fix up the data structures after loading a
+ // saved game. But there are cases where we don't. For instance, The
+ // Macintosh version of Monkey Island 1 used to convert the Mac0 music
+ // resources to General MIDI and play it through iMUSE as a rough
+ // approximation. Now it has its own player, but old savegame still
+ // have the iMUSE data in them. We have to skip that data, using a
+ // dummy iMUSE object, but since the resource is no longer recognizable
+ // to iMUSE, the fixup fails hard. So yes, this is a bit of a hack.
+
+ if (ser->isLoading() && fixAfterLoad) {
// Load all sounds that we need
fix_players_after_load(scumm);
fix_parts_after_load();