diff options
author | Travis Howell | 2003-09-01 17:11:09 +0000 |
---|---|---|
committer | Travis Howell | 2003-09-01 17:11:09 +0000 |
commit | 7b26efda21a113ce710048d983f00c6970561785 (patch) | |
tree | a1098ff795da3cc8c99885c397946d9756d19277 /scumm | |
parent | a2b1e9081cb7beea7f3f589eeecf542ba1911736 (diff) | |
download | scummvm-rg350-7b26efda21a113ce710048d983f00c6970561785.tar.gz scummvm-rg350-7b26efda21a113ce710048d983f00c6970561785.tar.bz2 scummvm-rg350-7b26efda21a113ce710048d983f00c6970561785.zip |
Add sound looping for Amiga zak/maniac
svn-id: r9959
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/sound.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 8283f5a072..dac94c496d 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -459,10 +459,19 @@ void Sound::playSound(int soundID) { // Some very basic sound effects support if (READ_BE_UINT16(ptr + 14) == 0x0880) { size = READ_BE_UINT16(ptr + 6); + // Not sure if this is correct start point + int start = READ_BE_UINT16(ptr + 8); rate = 11000; sound = (char *)malloc(size); - memcpy(sound,ptr + 100,size); - _scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, 127, 0, soundID); + memcpy(sound,ptr + start,size); + + // Experimental sound looping support + if (start == 98 | start == 96) + _scumm->_mixer->playRaw(NULL, sound, size, rate, + SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, 127, 0, soundID, + start,size); + else + _scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, 127, 0, soundID); return; } } @@ -758,7 +767,7 @@ void Sound::stopSound(int a) { _scumm->_imuse->stopSound(a); } else if (_scumm->_playerV2) { _scumm->_playerV2->stopSound (a); - } else if ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3)) { + } else if ((_scumm->_features & GF_AMIGA) && (_scumm->_version <= 3)) { // this handles stopping looped sounds for now _scumm->_mixer->stopID(a); } |