Make the bundle parser code a little cleaner :)
svn-id: r4198
This commit is contained in:
parent
eeda732b36
commit
9f699a21a1
1 changed files with 21 additions and 5 deletions
20
sound.cpp
20
sound.cpp
|
@ -768,11 +768,27 @@ void Scumm::decompressBundleSound(int index) {
|
|||
free(CompFinal);
|
||||
return;
|
||||
}
|
||||
size = READ_BE_UINT32(ptr); ptr+=4;
|
||||
|
||||
ptr+=12; /* Skip header */
|
||||
while(tag != 'DATA') {
|
||||
tag = READ_BE_UINT32(ptr); ptr+=4;
|
||||
switch(tag) {
|
||||
case 'FRMT':
|
||||
case 'TEXT':
|
||||
case 'REGN':
|
||||
case 'STOP':
|
||||
size = READ_BE_UINT32(ptr); ptr+=size+4;
|
||||
tag = READ_BE_UINT32(ptr); ptr+=4;
|
||||
break;
|
||||
|
||||
case 'DATA':
|
||||
size = READ_BE_UINT32(ptr); ptr+=4;
|
||||
break;
|
||||
|
||||
default:
|
||||
error("Unknown bundle header %c%c%c%c", tag>>24, tag>>16, tag>>8, tag);
|
||||
}
|
||||
}
|
||||
|
||||
Final = (unsigned char *)malloc(size);
|
||||
memcpy(&Final[0], &ptr[0], size);
|
||||
_mixer->play_raw(NULL, Final, size, 22050, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue