aboutsummaryrefslogtreecommitdiff
path: root/sound.cpp
diff options
context:
space:
mode:
authorJames Brown2002-04-30 07:40:56 +0000
committerJames Brown2002-04-30 07:40:56 +0000
commit4924ecd7da546f1c6b7108edb705391ca0d36243 (patch)
tree2b1e205d334adab00cf1e8d8a291c990fe76a4df /sound.cpp
parent2d51c864b0963cbdb5d15f6e461e5c3bb2b81f59 (diff)
downloadscummvm-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.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/sound.cpp b/sound.cpp
index 718c7c61f9..8376e92da7 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -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);