[Scummvm-cvs-logs] SF.net SVN: scummvm:[47590] scummvm/trunk/engines/sci/sound/audio.cpp
mthreepwood at users.sourceforge.net
mthreepwood at users.sourceforge.net
Wed Jan 27 06:10:39 CET 2010
Revision: 47590
http://scummvm.svn.sourceforge.net/scummvm/?rev=47590&view=rev
Author: mthreepwood
Date: 2010-01-27 05:10:38 +0000 (Wed, 27 Jan 2010)
Log Message:
-----------
SCI2.1 and onwards uses the 'new' DPCM8 which differs only by order. This fixes sound in the GK2 demo slideshow. Also, fix a logic bug with endianness in the DPCM decoders.
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/audio.cpp
Modified: scummvm/trunk/engines/sci/sound/audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/audio.cpp 2010-01-27 04:48:50 UTC (rev 47589)
+++ scummvm/trunk/engines/sci/sound/audio.cpp 2010-01-27 05:10:38 UTC (rev 47590)
@@ -124,17 +124,23 @@
s += tableDPCM16[b];
s = CLIP<int32>(s, -32768, 32767);
- *out++ = s;
+ *out++ = TO_LE_16(s);
}
}
static void deDPCM8Nibble(byte *soundBuf, int32 &s, byte b) {
- if (b & 8)
- s -= tableDPCM8[7 - (b & 7)];
- else
+ if (b & 8) {
+#ifdef ENABLE_SCI32
+ // SCI2.1 reverses the order of the table values here
+ if (getSciVersion() >= SCI_VERSION_2_1)
+ s -= tableDPCM8[b & 7];
+ else
+#endif
+ s -= tableDPCM8[7 - (b & 7)];
+ } else
s += tableDPCM8[b & 7];
s = CLIP<int32>(s, 0, 255);
- *soundBuf = TO_LE_16(s);
+ *soundBuf = s;
}
static void deDPCM8(byte *soundBuf, Common::SeekableReadStream &audioStream, uint32 n) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list