diff options
author | Paweł Kołodziejski | 2002-12-28 21:46:49 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2002-12-28 21:46:49 +0000 |
commit | 3102fd42e33d6feb810833737d11f9675d839667 (patch) | |
tree | 75ed8d789618a93021a70a98447e3b8d4a91b8bf /scumm/sound.cpp | |
parent | f63cb964685392d4954f23ce25abc7132ec4b375 (diff) | |
download | scummvm-rg350-3102fd42e33d6feb810833737d11f9675d839667.tar.gz scummvm-rg350-3102fd42e33d6feb810833737d11f9675d839667.tar.bz2 scummvm-rg350-3102fd42e33d6feb810833737d11f9675d839667.zip |
added more stuff for CMI music
svn-id: r6241
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r-- | scumm/sound.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index bcd44c1c54..62c0bf95d5 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1053,7 +1053,10 @@ void Sound::bundleMusicHandler(Scumm * scumm) { tag = READ_BE_UINT32(ptr); ptr += 4; switch(tag) { case MKID_BE('FRMT'): - size = READ_BE_UINT32(ptr); ptr += 24; + ptr += 12; + _bundleMusicSampleBits = READ_BE_UINT32(ptr); ptr += 4; + rate = READ_BE_UINT32(ptr); ptr += 4; + channels = READ_BE_UINT32(ptr); ptr += 4; break; case MKID_BE('TEXT'): case MKID_BE('REGN'): @@ -1099,7 +1102,16 @@ void Sound::bundleMusicHandler(Scumm * scumm) { ptr = _musicBundleBufFinal; byte * buffer = NULL; - uint32 final_size = decode12BitsSample(ptr, &buffer, size); + uint32 final_size; + if (_bundleMusicSampleBits == 12) { + final_size = decode12BitsSample(ptr, &buffer, size); + } else if (_bundleMusicSampleBits == 16) { + buffer = (byte*)malloc(size); + final_size = size; + memcpy(buffer, ptr, size); + } else { + warning("Sound::bundleMusicHandler to do more playStream options..."); + } if (_bundleMusicTrack == -1) { _bundleMusicTrack = _scumm->_mixer->playStream(NULL, _scumm->_mixer->_beginSlots - 1, buffer, final_size, rate, |