aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/sound.cpp
diff options
context:
space:
mode:
authorNeil Millstone2009-08-13 21:46:41 +0000
committerNeil Millstone2009-08-13 21:46:41 +0000
commita135a7f9385b59b91d5a7f23fd8792ff36afb353 (patch)
treef1512bebeb41858db45580f666d42d0177178417 /engines/agos/sound.cpp
parent83216b1d17ff12104a917314a9888001c12fc3ee (diff)
downloadscummvm-rg350-a135a7f9385b59b91d5a7f23fd8792ff36afb353.tar.gz
scummvm-rg350-a135a7f9385b59b91d5a7f23fd8792ff36afb353.tar.bz2
scummvm-rg350-a135a7f9385b59b91d5a7f23fd8792ff36afb353.zip
Allow VOCs to stream from disk. Disabled by default, use symbol STREAM_AUDIO_FROM_DISK to enable. See patch #2834001.
svn-id: r43357
Diffstat (limited to 'engines/agos/sound.cpp')
-rw-r--r--engines/agos/sound.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/engines/agos/sound.cpp b/engines/agos/sound.cpp
index d20c07a8c8..cdf28e98eb 100644
--- a/engines/agos/sound.cpp
+++ b/engines/agos/sound.cpp
@@ -133,8 +133,10 @@ public:
};
class VocSound : public BaseSound {
+ byte _flags;
public:
- VocSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigEndian = false) : BaseSound(mixer, file, base, bigEndian) {}
+ VocSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigEndian = false) : BaseSound(mixer, file, base, bigEndian), _flags(0) {}
+ Audio::AudioStream *makeAudioStream(uint sound);
void playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol = 0);
};
@@ -255,14 +257,15 @@ void WavSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType typ
_mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
}
-void VocSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) {
- if (_offsets == NULL)
- return;
-
+Audio::AudioStream *VocSound::makeAudioStream(uint sound) {
_file->seek(_offsets[sound], SEEK_SET);
+ return Audio::makeVOCStream(*_file, _flags);
+}
- Audio::AudioStream *stream = Audio::makeVOCStream(*_file, flags);
- _mixer->playInputStream(type, handle, stream);
+void VocSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) {
+ convertVolume(vol);
+ _flags = flags;
+ _mixer->playInputStream(type, handle, new LoopingAudioStream(this, sound, loopSound, (flags & Audio::Mixer::FLAG_LOOP) != 0), -1, vol);
}
void RawSound::playSound(uint sound, uint loopSound, Audio::Mixer::SoundType type, Audio::SoundHandle *handle, byte flags, int vol) {