aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-01-08 15:48:41 +0000
committerPaweł Kołodziejski2004-01-08 15:48:41 +0000
commit7396b99f384815ddc1b8809c02976a64e82ed3ea (patch)
tree9cb15eeddedaaa4c0f7a2253f2a863ff3d808b9f
parent0711b52e96489cf22f6b2903d822d24f0e0f1532 (diff)
downloadscummvm-rg350-7396b99f384815ddc1b8809c02976a64e82ed3ea.tar.gz
scummvm-rg350-7396b99f384815ddc1b8809c02976a64e82ed3ea.tar.bz2
scummvm-rg350-7396b99f384815ddc1b8809c02976a64e82ed3ea.zip
fixed comi bundle codec output_size and related stuff. also propably strange hang/100% cpu usage
svn-id: r12254
-rw-r--r--scumm/imuse_digi/dimuse_bndmgr.cpp2
-rw-r--r--scumm/imuse_digi/dimuse_codecs.cpp1
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp16
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.h3
4 files changed, 13 insertions, 9 deletions
diff --git a/scumm/imuse_digi/dimuse_bndmgr.cpp b/scumm/imuse_digi/dimuse_bndmgr.cpp
index e1ce994287..7bc233df28 100644
--- a/scumm/imuse_digi/dimuse_bndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_bndmgr.cpp
@@ -229,7 +229,7 @@ int32 BundleMgr::decompressSampleByIndex(int32 index, int32 offset, int32 size,
curBuf = _blockChache;
}
- if ((header_size != 0) && (skip > header_size))
+ if ((header_size != 0) && (skip >= header_size))
output_size -= skip;
if (output_size > size)
output_size = size;
diff --git a/scumm/imuse_digi/dimuse_codecs.cpp b/scumm/imuse_digi/dimuse_codecs.cpp
index 5b88d8369e..efab0a6382 100644
--- a/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/scumm/imuse_digi/dimuse_codecs.cpp
@@ -595,6 +595,7 @@ int32 decompressCodec(int32 codec, byte *comp_input, byte *comp_output, int32 in
left = 0x1000 - firstWord / 2;
output_size = left * 2;
}
+ output_size += firstWord;
} else {
startPos = 1;
for (int i = 0; i < channels; i++) {
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 6554b0ae0d..a34a9b4450 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -89,7 +89,7 @@ void ImuseDigiSndMgr::prepareSound(byte *ptr, int slot) {
case MKID_BE('REGN'):
size = READ_BE_UINT32(ptr); ptr += 4;
if (_sounds[slot].numRegions >= MAX_IMUSE_REGIONS) {
- warning("ImuseDigiSndMgr::prepareSound(%s) Not enough space for Region", _sounds[slot].name);
+ warning("ImuseDigiSndMgr::prepareSound(%d/%s) Not enough space for Region", _sounds[slot].soundId, _sounds[slot].name);
ptr += 8;
break;
}
@@ -104,7 +104,7 @@ void ImuseDigiSndMgr::prepareSound(byte *ptr, int slot) {
case MKID_BE('JUMP'):
size = READ_BE_UINT32(ptr); ptr += 4;
if (_sounds[slot].numJumps >= MAX_IMUSE_JUMPS) {
- warning("ImuseDigiSndMgr::prepareSound(%s) Not enough space for Jump", _sounds[slot].name);
+ warning("ImuseDigiSndMgr::prepareSound(%d/%s) Not enough space for Jump", _sounds[slot].soundId, _sounds[slot].name);
ptr += size;
break;
}
@@ -121,7 +121,7 @@ void ImuseDigiSndMgr::prepareSound(byte *ptr, int slot) {
size = READ_BE_UINT32(ptr); ptr += 4;
break;
default:
- error("ImuseDigiSndMgr::prepareSound(%s) Unknown sfx header '%s'", _sounds[slot].name, tag2str(tag));
+ error("ImuseDigiSndMgr::prepareSound(%d/%s) Unknown sfx header '%s'", _sounds[slot].soundId, _sounds[slot].name, tag2str(tag));
}
} while (tag != MKID_BE('DATA'));
_sounds[slot].offsetData = ptr - s_ptr;
@@ -225,7 +225,8 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch
else
error("ImuseDigiSndMgr::openSound() Don't know how load sound: %d", soundId);
_sounds[slot]._bundle->decompressSampleByIndex(soundId, 0, 0x2000, &ptr, 0);
- strcpy(_sounds[slot].name, soundName);
+ _sounds[slot].name[0] = 0;
+ _sounds[slot].soundId = soundId;
} else {
error("ImuseDigiSndMgr::openSound() Don't know how load sound: %d", soundId);
}
@@ -235,14 +236,15 @@ ImuseDigiSndMgr::soundStruct *ImuseDigiSndMgr::openSound(int32 soundId, const ch
result = openVoiceBundle(slot);
else if (soundGroup == IMUSE_MUSIC)
result = openMusicBundle(slot);
- else
+ else
error("ImuseDigiSndMgr::openSound() Don't know how load sound: %d", soundId);
_sounds[slot]._bundle->decompressSampleByName(soundName, 0, 0x2000, &ptr);
- _sounds[slot].name[0] = 0;
+ strcpy(_sounds[slot].name, soundName);
+ _sounds[slot].soundId = soundId;
} else {
error("ImuseDigiSndMgr::openSound() Don't know how load sound: %s", soundName);
}
- }
+ }
if (result) {
if (ptr == NULL) {
diff --git a/scumm/imuse_digi/dimuse_sndmgr.h b/scumm/imuse_digi/dimuse_sndmgr.h
index 9e72b7d719..3915fee81c 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.h
+++ b/scumm/imuse_digi/dimuse_sndmgr.h
@@ -77,7 +77,8 @@ public:
byte *allData;
int32 offsetData;
byte *resPtr;
- char name[30];
+ char name[15];
+ int soundId;
bool freeResPtr;
BundleMgr *_bundle;
_region region[MAX_IMUSE_REGIONS];