From ce7febcd70092ce0015e952af6dbfaae23bed22d Mon Sep 17 00:00:00 2001 From: Benjamin Haisch Date: Thu, 18 Jun 2009 08:22:52 +0000 Subject: TOLTECS: Reworked the ArchiveReader and ResourceCache classes. ResourceCache needs more work since resources are never freed (which is bad). --- engines/toltecs/sound.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines/toltecs/sound.cpp') diff --git a/engines/toltecs/sound.cpp b/engines/toltecs/sound.cpp index 08df1ceec2..b3d327f5f8 100644 --- a/engines/toltecs/sound.cpp +++ b/engines/toltecs/sound.cpp @@ -133,14 +133,13 @@ void Sound::internalPlaySound(int16 resIndex, int16 type, int16 volume, int16 pa // If all channels are in use no new sound will be played if (freeChannel >= 0) { - byte *soundData = _vm->_res->load(resIndex); - uint32 soundSize = _vm->_res->getCurItemSize(); + Resource *soundResource = _vm->_res->load(resIndex); byte flags = Audio::Mixer::FLAG_UNSIGNED; // Background sounds if (type == kChannelTypeBackground) flags |= Audio::Mixer::FLAG_LOOP; - Audio::AudioStream *stream = Audio::makeLinearInputStream(soundData, soundSize, 22050, flags, 0, 0); + Audio::AudioStream *stream = Audio::makeLinearInputStream(soundResource->data, soundResource->size, 22050, flags, 0, 0); channels[freeChannel].type = type; channels[freeChannel].resIndex = resIndex; -- cgit v1.2.3