aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2008-02-05 21:39:29 +0000
committerTorbjörn Andersson2008-02-05 21:39:29 +0000
commit441ec75a710be76045bcae16489cfe727f887758 (patch)
tree1ff8b5fbc4f1f9dcf4b120eb1f44e2d74727dcc5
parentc54e854e22c5c454fa502fe5b07d850d231eef1d (diff)
downloadscummvm-rg350-441ec75a710be76045bcae16489cfe727f887758.tar.gz
scummvm-rg350-441ec75a710be76045bcae16489cfe727f887758.tar.bz2
scummvm-rg350-441ec75a710be76045bcae16489cfe727f887758.zip
I think this is slightly easier to read...
svn-id: r30803
-rw-r--r--engines/sword2/music.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sword2/music.cpp b/engines/sword2/music.cpp
index 54a6474cd0..fd72ba8d52 100644
--- a/engines/sword2/music.cpp
+++ b/engines/sword2/music.cpp
@@ -172,9 +172,9 @@ static Audio::AudioStream *getAudioStream(SoundFileHandle *fh, const char *base,
// Custom AudioStream class to handle Broken Sword 2's audio compression.
// ----------------------------------------------------------------------------
-#define GetCompressedShift(n) ((n) >> 4)
-#define GetCompressedSign(n) (((n) >> 3) & 1)
-#define GetCompressedAmplitude(n) ((n) & 7)
+#define GetCompressedShift(n) (((n) >> 4) & 0x0F)
+#define GetCompressedSign(n) ((n) & 0x08)
+#define GetCompressedAmplitude(n) ((n) & 0x07)
CLUInputStream::CLUInputStream(Common::File *file, int size)
: _file(file), _firstTime(true), _bufferEnd(_outbuf + BUFFER_SIZE) {
@@ -236,7 +236,7 @@ void CLUInputStream::refill() {
in++;
}
- *out++ = sample;
+ *out++ = (int16)sample;
}
_pos = _outbuf;