diff options
author | James Brown | 2003-07-04 14:10:44 +0000 |
---|---|---|
committer | James Brown | 2003-07-04 14:10:44 +0000 |
commit | 093a31839beca7897032c245ca009da8de7a43d4 (patch) | |
tree | efd519b10abff021f3ead6108dc3c22dba6ddb17 /sound | |
parent | 0ed8e1ef36ae8d30edab9d4d74481ffac01f39b4 (diff) | |
download | scummvm-rg350-093a31839beca7897032c245ca009da8de7a43d4.tar.gz scummvm-rg350-093a31839beca7897032c245ca009da8de7a43d4.tar.bz2 scummvm-rg350-093a31839beca7897032c245ca009da8de7a43d4.zip |
Insert preliminary Zak256 sound looping support. It's not perfect, as some Zak256 sounds only loop a part of the sample - which our mixer API doesn't yet support.
svn-id: r8741
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 3a34642030..6dbead7e49 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -229,6 +229,11 @@ int SoundMixer::insertChannel(PlayingSoundHandle *handle, Channel *chan) { } int SoundMixer::playRaw(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, int id) { + // Prevent duplicate sounds + for (int i = 0; i != NUM_CHANNELS; i++) + if (_channels[i] != NULL && _channels[i]->_id == id) + return -1; + return insertChannel(handle, new ChannelRaw(this, sound, size, rate, flags, id)); } |