[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.56,2.57 sound.cpp,1.175,1.176
Travis Howell
kirben at users.sourceforge.net
Fri Jul 18 20:55:21 CEST 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv19145
Modified Files:
charset.cpp sound.cpp
Log Message:
More fix from Hibernatus
Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.56
retrieving revision 2.57
diff -u -d -r2.56 -r2.57
--- charset.cpp 18 Jul 2003 05:49:20 -0000 2.56
+++ charset.cpp 19 Jul 2003 03:54:32 -0000 2.57
@@ -929,7 +929,7 @@
{
_color = color;
_shadowColor = (_vm->_features & GF_FMTOWNS) ? 8 : 0;
- if (_vm->_features & GF_FMTOWNS) {
+ if (_vm->_features & GF_FMTOWNS || _vm->_gameId == GID_INDY3_256) {
_dropShadow = ((_color & 0x80) != 0);
_color &= 0x7f;
} else if (_vm->_features & GF_16COLOR) {
Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -d -r1.175 -r1.176
--- sound.cpp 18 Jul 2003 14:48:18 -0000 1.175
+++ sound.cpp 19 Jul 2003 03:54:33 -0000 1.176
@@ -389,34 +389,42 @@
switch(type) {
case 0: { // Sound effect
- int waveSize = READ_LE_UINT32(ptr + 0x22);
- int loopStart = READ_LE_UINT32(ptr + 0x26);
- int loopEnd = READ_LE_UINT32(ptr + 0x2A);
- rate = (ptr[0x32] == 60) ? 11025 : 22050; // 48 means 22050
+ int numInstruments = *(ptr + 0x14);
+ ptr += 0x16;
+ size -= 0x16;
+ while (numInstruments--) {
+ int waveSize = READ_LE_UINT32(ptr + 0x0C);
+ int loopStart = READ_LE_UINT32(ptr + 0x10);
+ int loopEnd = READ_LE_UINT32(ptr + 0x14);
+ // it's not exactly * 10, maybe it's not even linear, but * 10 sounds ok.
+ rate = READ_LE_UINT32(ptr + 0x18) * 10;
- if (size - 0x36 < waveSize) {
- warning("Wrong wave size in sound #%i: %i", soundID, waveSize);
- waveSize = size - 0x36;
- }
- ptr += 0x36;
- sound = (char *)malloc(waveSize);
- for (int x = 0; x < waveSize; x++) {
- int bit = *ptr++;
- if (bit < 0x80)
- sound[x] = 0x7F - bit;
- else
- sound[x] = bit;
- }
+ ptr += 0x20;
+ size -= 0x20;
+ if (size < waveSize) {
+ warning("Wrong wave size in sound #%i: %i", soundID, waveSize);
+ waveSize = size - 0x36;
+ }
+ sound = (char *)malloc(waveSize);
+ for (int x = 0; x < waveSize; x++) {
+ int bit = *ptr++;
+ if (bit < 0x80)
+ sound[x] = 0x7F - bit;
+ else
+ sound[x] = bit;
+ }
+ size -= waveSize;
- if (loopEnd > 0) {
- flags |= SoundMixer::FLAG_LOOP;
- if ((loopEnd < waveSize) || (loopStart > 0)) {
- // FIXME: Implement partial loops
- warning("Partial loops not implemented. Loop at 0x%X thru 0x%X", loopStart, loopEnd);
+ if (loopEnd > 0) {
+ flags |= SoundMixer::FLAG_LOOP;
+ if ((loopEnd < waveSize) || (loopStart > 0)) {
+ // FIXME: Implement partial loops
+ warning("Partial loops not implemented. Loop at 0x%X thru 0x%X", loopStart, loopEnd);
+ }
}
- }
- _scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID);
+ _scumm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID);
+ }
break;
}
@@ -428,7 +436,7 @@
ptr += (32*4); // Skip preset values (mute, channel, volume, transpose)
ptr += 8; // (Unknown)
- ptr += numInstruments; // Instrument channel's
+ ptr += 6; // Instrument channel's. Always 6 bytes according to the disassembly.
tuneSize = READ_LE_UINT32(ptr);
ptr += 5;
More information about the Scummvm-git-logs
mailing list