aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göffringmann2003-08-02 16:53:46 +0000
committerRobert Göffringmann2003-08-02 16:53:46 +0000
commitd82969b3768ea8634adcb06b394cc45d38213e9f (patch)
tree605b14365b94f989319c4a1fc01207fd618d5ff2
parent0142ee260e2d4ca6e86114e09149d1ac3aeb34ea (diff)
downloadscummvm-rg350-d82969b3768ea8634adcb06b394cc45d38213e9f.tar.gz
scummvm-rg350-d82969b3768ea8634adcb06b394cc45d38213e9f.tar.bz2
scummvm-rg350-d82969b3768ea8634adcb06b394cc45d38213e9f.zip
correct sound looping, thanks to our new mixer. :)
svn-id: r9418
-rw-r--r--sky/sound.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/sky/sound.cpp b/sky/sound.cpp
index ce0f709e1c..3739b69bf8 100644
--- a/sky/sound.cpp
+++ b/sky/sound.cpp
@@ -1118,14 +1118,18 @@ void SkySound::playSound(uint16 sound, uint16 volume, uint8 channel) {
byte flags = SoundMixer::FLAG_UNSIGNED;
- if (dataSize == dataLoop)
+ uint32 loopSta = 0, loopEnd = 0;
+ if (dataLoop) {
+ loopSta = dataSize - dataLoop;
+ loopEnd = dataSize;
flags |= SoundMixer::FLAG_LOOP;
+ }
_mixer->setVolume(volume);
if (channel == 0)
- _mixer->playRaw(&_ingameSound0, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH0);
+ _mixer->playRaw(&_ingameSound0, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH0, loopSta, loopEnd);
else
- _mixer->playRaw(&_ingameSound1, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH1);
+ _mixer->playRaw(&_ingameSound1, _soundData + dataOfs, dataSize, sampleRate, flags, SOUND_CH1, loopSta, loopEnd);
}
void SkySound::fnStartFx(uint32 sound, uint8 channel) {