diff options
author | James Brown | 2002-04-30 07:40:56 +0000 |
---|---|---|
committer | James Brown | 2002-04-30 07:40:56 +0000 |
commit | 4924ecd7da546f1c6b7108edb705391ca0d36243 (patch) | |
tree | 2b1e205d334adab00cf1e8d8a291c990fe76a4df /sound.cpp | |
parent | 2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59 (diff) | |
download | scummvm-rg350-4924ecd7da546f1c6b7108edb705391ca0d36243.tar.gz scummvm-rg350-4924ecd7da546f1c6b7108edb705391ca0d36243.tar.bz2 scummvm-rg350-4924ecd7da546f1c6b7108edb705391ca0d36243.zip |
Added missing Dig smush codecs. Dig movies are now perfect, graphically.
Thanks Aquadran.
svn-id: r4139
Diffstat (limited to 'sound.cpp')
-rw-r--r-- | sound.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -680,7 +680,8 @@ typedef struct {int offset, size, codec;} COMP_table; void Scumm::decompressBundleSound(int index) { int i, z; COMP_table table[50]; - unsigned char *CompInput, *CompOutput, *CompFinal; + static unsigned char *CompInput, *CompOutput, *CompFinal; + static bool initted; int outputSize, finalSize; fileSeek(_sfxFile, bundle_table[index].offset, SEEK_SET); @@ -702,7 +703,11 @@ void Scumm::decompressBundleSound(int index) { fileReadDwordBE(_sfxFile); } - CompFinal = (unsigned char *)alloc(1000000); + if (!initted) { + CompFinal = (unsigned char *)alloc(1000000); + initted = true; + } + finalSize = 0; /* Decompress data */ @@ -755,11 +760,16 @@ void Scumm::decompressBundleSound(int index) { /* FIXME: This is nasty. We are actually sending the whole decompressed packet to the mixer.. but the packet actually contains further subblocks! (eg, sync) */ - _mixer->play_raw(NULL, CompFinal, finalSize,22050, SoundMixer::FLAG_AUTOFREE|SoundMixer::FLAG_UNSIGNED); + _mixer->play_raw(NULL, CompFinal, finalSize,22050, SoundMixer::FLAG_UNSIGNED); } void Scumm::playBundleSound(char *sound) { + if (!_sfxFile) { + warning("playBundleSound: SFX file is not open"); + return; + } + for (int i=0; i < num_sound_effects; i++) { if (!scumm_stricmp(sound, bundle_table[i].filename)) { decompressBundleSound(i); |