diff options
author | Max Horn | 2010-01-28 09:38:21 +0000 |
---|---|---|
committer | Max Horn | 2010-01-28 09:38:21 +0000 |
commit | 1c906a1f08f9d1f316c2efd65a347c00e07bc469 (patch) | |
tree | e8f741ede9a33e2bd9748faeb4a46130a722f950 /engines/sword1 | |
parent | f85c77d63ea85d62cb5bbf55fe71dd9c42e6924b (diff) | |
download | scummvm-rg350-1c906a1f08f9d1f316c2efd65a347c00e07bc469.tar.gz scummvm-rg350-1c906a1f08f9d1f316c2efd65a347c00e07bc469.tar.bz2 scummvm-rg350-1c906a1f08f9d1f316c2efd65a347c00e07bc469.zip |
Hide VagStream implementation, only expose it via a factory method
svn-id: r47634
Diffstat (limited to 'engines/sword1')
-rw-r--r-- | engines/sword1/music.cpp | 3 | ||||
-rw-r--r-- | engines/sword1/sound.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/engines/sword1/music.cpp b/engines/sword1/music.cpp index a10e705656..4661b042af 100644 --- a/engines/sword1/music.cpp +++ b/engines/sword1/music.cpp @@ -33,6 +33,7 @@ #include "sword1/music.h" #include "sound/mixer.h" +#include "sound/audiostream.h" #include "sound/decoders/aiff.h" #include "sound/decoders/flac.h" #include "sound/decoders/mp3.h" @@ -137,7 +138,7 @@ bool MusicHandle::playPSX(uint16 id, bool loop) { // not over file size if ((size != 0) && (size != 0xffffffff) && ((int32)(offset + size) <= _file.size())) { _file.seek(offset, SEEK_SET); - _audioSource = Audio::makeLoopingAudioStream(new Audio::VagStream(_file.readStream(size)), loop ? 0 : 1); + _audioSource = Audio::makeLoopingAudioStream(Audio::makeVagStream(_file.readStream(size)), loop ? 0 : 1); fadeUp(); } else { _audioSource = NULL; diff --git a/engines/sword1/sound.cpp b/engines/sword1/sound.cpp index 43a5b25d76..a9fe37242b 100644 --- a/engines/sword1/sound.cpp +++ b/engines/sword1/sound.cpp @@ -36,6 +36,7 @@ #include "sword1/logic.h" #include "sword1/sword1.h" +#include "sound/audiostream.h" #include "sound/decoders/flac.h" #include "sound/decoders/mp3.h" #include "sound/decoders/raw.h" @@ -259,7 +260,7 @@ void Sound::playSample(QueueElement *elem) { if (SwordEngine::isPsx()) { uint32 size = READ_LE_UINT32(sampleData); - Audio::AudioStream *audStream = Audio::makeLoopingAudioStream(new Audio::VagStream(new Common::MemoryReadStream(sampleData + 4, size-4)), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1); + Audio::AudioStream *audStream = Audio::makeLoopingAudioStream(Audio::makeVagStream(new Common::MemoryReadStream(sampleData + 4, size-4)), (_fxList[elem->id].type == FX_LOOP) ? 0 : 1); _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &elem->handle, audStream, elem->id, volume, pan); } else { uint32 size = READ_LE_UINT32(sampleData + 0x28); @@ -367,7 +368,7 @@ bool Sound::startSpeech(uint16 roomNo, uint16 localNo) { _cowFile.seek(index * 2048); Common::MemoryReadStream *tmp = _cowFile.readStream(sampleSize); assert(tmp); - stream = new Audio::VagStream(tmp); + stream = Audio::makeVagStream(tmp); _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &_speechHandle, stream, SOUND_SPEECH_ID, speechVol, speechPan); // with compressed audio, we can't calculate the wave volume. // so default to talking. |