diff options
author | Max Horn | 2009-10-14 23:30:06 +0000 |
---|---|---|
committer | Max Horn | 2009-10-14 23:30:06 +0000 |
commit | d4d1346ceba02d0d24b364a8295c85dd967116b6 (patch) | |
tree | e4eeb15025550c17ff257bf1c59edcea77d02a36 /engines | |
parent | edf682791365e15fdbec1587ecde012c53fce6f6 (diff) | |
download | scummvm-rg350-d4d1346ceba02d0d24b364a8295c85dd967116b6.tar.gz scummvm-rg350-d4d1346ceba02d0d24b364a8295c85dd967116b6.tar.bz2 scummvm-rg350-d4d1346ceba02d0d24b364a8295c85dd967116b6.zip |
TUCKER: Convert one more loadWAVFromStream instance to makeWAVStream
svn-id: r45101
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tucker/resource.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/engines/tucker/resource.cpp b/engines/tucker/resource.cpp index f22061468c..43fe9cabd3 100644 --- a/engines/tucker/resource.cpp +++ b/engines/tucker/resource.cpp @@ -943,21 +943,11 @@ void TuckerEngine::loadSound(Audio::Mixer::SoundType type, int num, int volume, } char fileName[64]; snprintf(fileName, sizeof(fileName), fmt, num); - Common::File f; - if (f.open(fileName)) { - int size, rate; - uint8 flags = 0; - if (Audio::loadWAVFromStream(f, size, rate, flags)) { - uint8 *data = (uint8 *)malloc(size); - if (data) { - f.read(data, size); - flags |= Audio::Mixer::FLAG_AUTOFREE; - if (loop) { - flags |= Audio::Mixer::FLAG_LOOP; - } - stream = Audio::makeLinearInputStream(data, size, rate, flags, 0, 0); - } - } + Common::File *f = new Common::File; + if (f->open(fileName)) { + stream = Audio::makeWAVStream(f, true, loop); + } else { + delete f; } } if (stream) { |