From de7721c63863018dc70aa5b7cf135d373c45892a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 6 Jan 2009 12:33:59 +0000 Subject: Sound energy values are now stored in a list, to account for the fact that the original decompressed sounds on the fly, but we're decompressing them when the sound is being loaded svn-id: r35752 --- engines/made/sound.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'engines/made/sound.cpp') diff --git a/engines/made/sound.cpp b/engines/made/sound.cpp index a88274f205..e397bd584f 100644 --- a/engines/made/sound.cpp +++ b/engines/made/sound.cpp @@ -24,13 +24,14 @@ */ #include "common/endian.h" +#include "common/list.h" #include "common/util.h" #include "made/sound.h" namespace Made { -int soundEnergy = 0; +Common::List soundEnergy; void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCount) { @@ -68,8 +69,8 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou case 0: memset(soundBuffer, 0x80, workChunkSize); - workSample = 0; - soundEnergy = 0; + workSample = 0; + soundEnergy.push_back(0); break; case 1: @@ -96,14 +97,14 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou } } - soundEnergy = type - 1; + soundEnergy.push_back(type - 1); break; case 5: for (i = 0; i < workChunkSize; i++) soundBuffer[i] = *source++; workSample = soundBuffer[workChunkSize - 1] - 128; - soundEnergy = 4; + soundEnergy.push_back(type - 1); break; default: -- cgit v1.2.3