aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2010-01-28 10:08:54 +0000
committerJohannes Schickel2010-01-28 10:08:54 +0000
commit42c4316f98bd4b5042a058a0fbb2a20bb1f7398d (patch)
treef0bc045725dbfa75b031dc462ad06b581578166a /engines
parenta408a025b6fcab92442a6a0baa49e8b61b3bdfcd (diff)
downloadscummvm-rg350-42c4316f98bd4b5042a058a0fbb2a20bb1f7398d.tar.gz
scummvm-rg350-42c4316f98bd4b5042a058a0fbb2a20bb1f7398d.tar.bz2
scummvm-rg350-42c4316f98bd4b5042a058a0fbb2a20bb1f7398d.zip
Get rid of use of Audio::makeRawMemoryStream_OLD in SKY.
svn-id: r47638
Diffstat (limited to 'engines')
-rw-r--r--engines/sky/sound.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/engines/sky/sound.cpp b/engines/sky/sound.cpp
index caa94506dc..eb9f1e57b9 100644
--- a/engines/sky/sound.cpp
+++ b/engines/sky/sound.cpp
@@ -1111,19 +1111,24 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) {
uint32 dataLoop = READ_BE_UINT16(_sfxInfo + (sound << 3) + 6);
dataOfs += _sfxBaseOfs;
- uint32 loopSta = 0, loopEnd = 0;
+ Audio::SeekableAudioStream *stream = Audio::makeRawMemoryStream(_soundData + dataOfs, dataSize, sampleRate,
+ Audio::FLAG_UNSIGNED, DisposeAfterUse::NO);
+
+ Audio::AudioStream *output = 0;
if (dataLoop) {
- loopSta = dataSize - dataLoop;
- loopEnd = dataSize;
- }
+ uint32 loopSta = dataSize - dataLoop;
+ uint32 loopEnd = dataSize;
- Audio::AudioStream *stream = Audio::makeRawMemoryStream_OLD(_soundData + dataOfs, dataSize, sampleRate,
- Audio::FLAG_UNSIGNED, loopSta, loopEnd, DisposeAfterUse::NO);
+ output = Audio::makeLoopingAudioStream(stream, Audio::Timestamp(0, loopSta, sampleRate),
+ Audio::Timestamp(0, loopEnd, sampleRate), 0);
+ } else {
+ output = stream;
+ }
if (channel == 0)
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_ingameSound0, stream, SOUND_CH0, volume, 0);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_ingameSound0, output, SOUND_CH0, volume, 0);
else
- _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_ingameSound1, stream, SOUND_CH1, volume, 0);
+ _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &_ingameSound1, output, SOUND_CH1, volume, 0);
}
void Sound::fnStartFx(uint32 sound, uint8 channel) {