Correct HSHD sounds

svn-id: r14995
This commit is contained in:
Travis Howell 2004-09-10 12:07:53 +00:00
parent f16ee4dfaf
commit 71866c1287

View File

@ -257,14 +257,14 @@ void Sound::playSound(int soundID, int offset) {
}
// Support for Putt-Putt sounds - very hackish, too 8-)
else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK') || READ_UINT32(ptr) == MKID('HSHD')) {
// Later game start have 8 less
int diff = (READ_UINT32(ptr) == MKID('HSHD')) ? 8 : 0;
if (READ_UINT32(ptr) == MKID('HSHD')) {
rate = READ_LE_UINT16(ptr + 14);
ptr += READ_BE_UINT32(ptr + 4);
} else {
rate = READ_LE_UINT16(ptr + 22);
ptr += 8 + READ_BE_UINT32(ptr + 12);
}
// TODO - discover what data the first chunk, HSHD, contains
// it might be useful here.
rate = READ_LE_UINT16(ptr + 22 - diff);
ptr += 8 + READ_BE_UINT32(ptr + 12 - diff);
if (READ_UINT32(ptr) != MKID('SDAT'))
return; // abort