aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorMax Horn2002-05-17 21:58:59 +0000
committerMax Horn2002-05-17 21:58:59 +0000
commit17319703a970439f68c0d0426b5022e8bb629fff (patch)
treef3dec940ab930c77939d976d7acb1a364fe27fab /sound.cpp
parent9c01a88e90b45c97c3a8b2b86f20a8f7c93f09a0 (diff)
downloadscummvm-rg350-17319703a970439f68c0d0426b5022e8bb629fff.tar.gz
scummvm-rg350-17319703a970439f68c0d0426b5022e8bb629fff.tar.bz2
scummvm-rg350-17319703a970439f68c0d0426b5022e8bb629fff.zip
added support for Mac1 sounds resources (appear in MI1/MacOS version). Still needs some work but is usable. Now if I could figure out Mac0...
svn-id: r4346
Diffstat (limited to 'sound.cpp')
-rw-r--r--sound.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/sound.cpp b/sound.cpp
index f752b6f1a6..fe56ceb386 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -181,6 +181,25 @@ void Scumm::playSound(int sound)
return;
}
+ // Support for SFX in Monkey Island 1, Mac version
+ // This is rather hackish right now, but works OK. SFX are not sounding
+ // 100% correct, though, not sure right now what is causing this.
+ if (ptr != NULL && READ_UINT32_UNALIGNED(ptr) == MKID('Mac1')) {
+
+ // Read info from the header
+ int size = READ_UINT32_UNALIGNED(ptr+0x60);
+ int rate = READ_UINT32_UNALIGNED(ptr+0x64) >> 16;
+
+ // Skip over the header (fixed size)
+ ptr += 0x72;
+
+ // Allocate a sound buffer, copy the data into it, and play
+ char *sound = (char*)malloc(size);
+ memcpy(sound, ptr, size);
+ _mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+ return;
+ }
+
if ((_features & GF_OLD256) || (_gameId == GID_MONKEY_VGA))
return; /* FIXME */