diff options
author | Matthew Hoops | 2009-08-20 20:41:12 +0000 |
---|---|---|
committer | Matthew Hoops | 2009-08-20 20:41:12 +0000 |
commit | b4c7cd0484be154b2e47ece3bd5b0e0e6911d041 (patch) | |
tree | 463de2d071a2a38553909752668160ae079cd2f8 | |
parent | 8f587ed5e43d31d4cf2139b4d170ed9d726f2acc (diff) | |
download | scummvm-rg350-b4c7cd0484be154b2e47ece3bd5b0e0e6911d041.tar.gz scummvm-rg350-b4c7cd0484be154b2e47ece3bd5b0e0e6911d041.tar.bz2 scummvm-rg350-b4c7cd0484be154b2e47ece3bd5b0e0e6911d041.zip |
Fix 16-bit SOL audio on little endian systems. Fixes the white noise in the Gabriel Knight demo.
svn-id: r43569
-rw-r--r-- | engines/sci/sfx/core.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp index 95d79b3666..a1e2a0b0f8 100644 --- a/engines/sci/sfx/core.cpp +++ b/engines/sci/sfx/core.cpp @@ -1060,7 +1060,7 @@ static void deDPCM16(byte *soundBuf, Common::SeekableReadStream &audioStream, ui s += tableDPCM16[b]; s = CLIP<int32>(s, -32768, 32767); - *out++ = TO_BE_16(s); + *out++ = s; } } @@ -1105,8 +1105,13 @@ static byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size, // Convert the SOL stream flags to our own format flags = 0; - if (audioFlags & kSolFlag16Bit) + if (audioFlags & kSolFlag16Bit) { flags |= Audio::Mixer::FLAG_16BITS; +#ifdef SCUMM_LITTLE_ENDIAN + flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN; +#endif + } + if (!(audioFlags & kSolFlagIsSigned)) flags |= Audio::Mixer::FLAG_UNSIGNED; |