aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorPaweł Kołodziejski2009-01-10 17:08:29 +0000
committerPaweł Kołodziejski2009-01-10 17:08:29 +0000
commitcffe7b837996db1707d1bedcf7d059876212be98 (patch)
treeca1302e8a2ea83eae131bfe083e8eb0b09b426f8 /engines/scumm
parent936f4c0963fd1f87b4882ec5de38dc989deb1bb5 (diff)
downloadscummvm-rg350-cffe7b837996db1707d1bedcf7d059876212be98.tar.gz
scummvm-rg350-cffe7b837996db1707d1bedcf7d059876212be98.tar.bz2
scummvm-rg350-cffe7b837996db1707d1bedcf7d059876212be98.zip
fixed radio chatter sfx
svn-id: r35804
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/imuse_digi/dimuse.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp
index 54c8c041c4..d97b6b7183 100644
--- a/engines/scumm/imuse_digi/dimuse.cpp
+++ b/engines/scumm/imuse_digi/dimuse.cpp
@@ -311,10 +311,12 @@ void IMuseDigital::callback() {
}
} else if (bits == 8) {
curFeedSize = _sound->getDataFromRegion(track->soundDesc, track->curRegion, &tmpSndBufferPtr, track->regionOffset, feedSize);
- if (_radioChatterSFX && track->volGroupId == IMUSE_VOLGRP_VOICE) {
+ if (_radioChatterSFX && track->soundId == 10000) {
+ if (curFeedSize > feedSize)
+ curFeedSize = feedSize;
byte *buf = new byte[curFeedSize];
int index = 0;
- int count = curFeedSize;
+ int count = curFeedSize - 4;
byte *ptr_1 = tmpSndBufferPtr;
byte *ptr_2 = tmpSndBufferPtr + 4;
int value = ptr_1[0] - 0x80;
@@ -324,9 +326,13 @@ void IMuseDigital::callback() {
do {
int t = *ptr_1++;
int v = t - (value / 4);
- value = (int)(*(ptr_2++) - 0x80) + (value - t + 128);
- buf[index++] = (byte)v * 4;
+ value = *ptr_2++ - 0x80 + (value - t + 0x80);
+ buf[index++] = v * 2 + 0x80;
} while (--count);
+ buf[curFeedSize - 1] = 0x80;
+ buf[curFeedSize - 2] = 0x80;
+ buf[curFeedSize - 3] = 0x80;
+ buf[curFeedSize - 4] = 0x80;
delete[] tmpSndBufferPtr;
tmpSndBufferPtr = buf;
}