diff options
author | Filippos Karapetis | 2008-04-23 17:21:49 +0000 |
---|---|---|
committer | Filippos Karapetis | 2008-04-23 17:21:49 +0000 |
commit | b69ffa922aefeaa649a56a1ea8d9a0bd646db76c (patch) | |
tree | 994336d9259d8bbddfbe875b10e83036a778a718 /engines/made/resource.cpp | |
parent | 79d6c9f04209774f5222e161136627c07beb1013 (diff) | |
download | scummvm-rg350-b69ffa922aefeaa649a56a1ea8d9a0bd646db76c.tar.gz scummvm-rg350-b69ffa922aefeaa649a56a1ea8d9a0bd646db76c.tar.bz2 scummvm-rg350-b69ffa922aefeaa649a56a1ea8d9a0bd646db76c.zip |
In-game sound effects and voices should be working correctly now.
Implemented the following opcodes:
- o1_PLAYSND
- o1_ISSND
- o1_STOPSND
- o1_PLAYVOICE
- o1_SOUNDRATE
- o1_SETVOLUME
svn-id: r31666
Diffstat (limited to 'engines/made/resource.cpp')
-rw-r--r-- | engines/made/resource.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index cf49e0201b..be212be733 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -24,6 +24,7 @@ */ #include "common/endian.h" +#include "sound/mixer.h" #include "made/resource.h" #include "made/graphics.h" @@ -161,12 +162,15 @@ void SoundResource::load(byte *source, int size) { _soundSize = chunkCount * chunkSize; _soundData = new byte[_soundSize]; - decompressSound(source + 14, _soundData, chunkSize, chunkCount); - + decompressSound(source + 14, _soundData, chunkSize, chunkCount); } -Audio::AudioStream *SoundResource::getAudioStream() { - return Audio::makeLinearInputStream(_soundData, _soundSize, 22050, 0, 0, 0); +Audio::AudioStream *SoundResource::getAudioStream(int soundRate, bool loop) { + byte flags = Audio::Mixer::FLAG_UNSIGNED; + if (loop) + flags |= Audio::Mixer::FLAG_LOOP; + + return Audio::makeLinearInputStream(_soundData, _soundSize, soundRate, flags, 0, 0); } /* MenuResource */ |