diff options
author | Torbjörn Andersson | 2004-10-19 17:12:53 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-10-19 17:12:53 +0000 |
commit | 82b6902b5661b6b9832d39ae33627bc964cccf34 (patch) | |
tree | 111ab2099a766c2a81f870adb9f8265306edd56e /saga/sndres.cpp | |
parent | d37a55ef19cfe85a67547c0255bd37938d96d8f8 (diff) | |
download | scummvm-rg350-82b6902b5661b6b9832d39ae33627bc964cccf34.tar.gz scummvm-rg350-82b6902b5661b6b9832d39ae33627bc964cccf34.tar.bz2 scummvm-rg350-82b6902b5661b6b9832d39ae33627bc964cccf34.zip |
Initial, and slightly buggy, support for sound effects.
svn-id: r15614
Diffstat (limited to 'saga/sndres.cpp')
-rw-r--r-- | saga/sndres.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/saga/sndres.cpp b/saga/sndres.cpp index ef69ebe9bc..f8ed8b41e7 100644 --- a/saga/sndres.cpp +++ b/saga/sndres.cpp @@ -55,6 +55,21 @@ SndRes::SndRes(SagaEngine *vm) : _vm(vm) { _init = 1; } +int SndRes::playSound(uint32 sound_rn, int volume) { + R_SOUNDBUFFER snd_buffer; + + debug(0, "SndRes::playSound(%ld)", sound_rn); + + if (load(_sfx_ctxt, sound_rn, &snd_buffer) != R_SUCCESS) { +debug(0, "Failed to load sound"); + return R_FAILURE; + } + + _vm->_sound->playSound(&snd_buffer, volume); + + return R_SUCCESS; +} + int SndRes::playVoice(uint32 voice_rn) { R_SOUNDBUFFER snd_buffer; int result; |