diff options
author | Joost Peters | 2003-03-11 18:32:58 +0000 |
---|---|---|
committer | Joost Peters | 2003-03-11 18:32:58 +0000 |
commit | 5af41d1bc657d071fa939bd3f326c3562f4d4850 (patch) | |
tree | 8c02b96a435f2cb261829f3636e74404fae298fa /sky/sound.cpp | |
parent | d7f21b46e84c259f28c6382cba1b074fddd52839 (diff) | |
download | scummvm-rg350-5af41d1bc657d071fa939bd3f326c3562f4d4850.tar.gz scummvm-rg350-5af41d1bc657d071fa939bd3f326c3562f4d4850.tar.bz2 scummvm-rg350-5af41d1bc657d071fa939bd3f326c3562f4d4850.zip |
added timers, full cd-intro and fixed some minor issues
svn-id: r6797
Diffstat (limited to 'sky/sound.cpp')
-rw-r--r-- | sky/sound.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sky/sound.cpp b/sky/sound.cpp index 99f4106336..33ca456f5d 100644 --- a/sky/sound.cpp +++ b/sky/sound.cpp @@ -27,17 +27,30 @@ SkySound::SkySound(SoundMixer *mixer) { _mixer = mixer; + _voiceHandle = 0; + _effectHandle = 0; + _bgSoundHandle = 0; } int SkySound::playVoice(byte *sound, uint32 size) { + return playSound(sound, size, &_voiceHandle); +} + + +int SkySound::playBgSound(byte *sound, uint32 size) { + + size -= 512; //Hack to get rid of the annoying pop at the end of some bg sounds + return playSound(sound, size, &_bgSoundHandle); +} + +int SkySound::playSound(byte *sound, uint32 size, PlayingSoundHandle *handle) { + byte flags = 0; flags |= SoundMixer::FLAG_UNSIGNED|SoundMixer::FLAG_AUTOFREE; size -= sizeof(struct dataFileHeader); byte *buffer = (byte *)malloc(size); memcpy(buffer, sound+sizeof(struct dataFileHeader), size); - return _mixer->playRaw(NULL, buffer, size, 11025, flags); - + return _mixer->playRaw(handle, buffer, size, 11025, flags); } - |