diff options
author | Oliver Kiehl | 2002-11-10 16:23:02 +0000 |
---|---|---|
committer | Oliver Kiehl | 2002-11-10 16:23:02 +0000 |
commit | fb8f8c6105893ccc2e4fa2cc39deaadb561ccfe5 (patch) | |
tree | a0a20577fa586078429606b6b49b00d4b3d7593c /sound/mixer.cpp | |
parent | 0eb3a9017dc5381fa06ec3dd5284d0f46dd240cf (diff) | |
download | scummvm-rg350-fb8f8c6105893ccc2e4fa2cc39deaadb561ccfe5.tar.gz scummvm-rg350-fb8f8c6105893ccc2e4fa2cc39deaadb561ccfe5.tar.bz2 scummvm-rg350-fb8f8c6105893ccc2e4fa2cc39deaadb561ccfe5.zip |
added looping support to playRaw
svn-id: r5501
Diffstat (limited to 'sound/mixer.cpp')
-rw-r--r-- | sound/mixer.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index e176e93431..9222198c6f 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -293,6 +293,11 @@ SoundMixer::ChannelRaw::ChannelRaw(SoundMixer * mixer, void * sound, uint32 size _size = _size >> 1; if (_flags & FLAG_STEREO) _size = _size >> 1; + + if (flags & FLAG_LOOP) { + _loop_ptr = sound; + _loop_size = size; + } } @@ -623,8 +628,16 @@ void SoundMixer::ChannelRaw::mix(int16 * data, uint len) { free(s_org); } - if (_size < 1) - realDestroy(); + if (_size < 1) { + if (_flags & FLAG_LOOP) { + _ptr = _loop_ptr; + _size = _loop_size; + _pos = 0; + _fpPos = 0; + } else { + realDestroy(); + } + } } |