[Scummvm-cvs-logs] SF.net SVN: scummvm:[35804] scummvm/trunk/engines/scumm/imuse_digi/dimuse. cpp

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sat Jan 10 18:08:29 CET 2009


Revision: 35804
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35804&view=rev
Author:   aquadran
Date:     2009-01-10 17:08:29 +0000 (Sat, 10 Jan 2009)

Log Message:
-----------
fixed radio chatter sfx

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp

Modified: scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp
===================================================================
--- scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2009-01-10 14:10:04 UTC (rev 35803)
+++ scummvm/trunk/engines/scumm/imuse_digi/dimuse.cpp	2009-01-10 17:08:29 UTC (rev 35804)
@@ -311,10 +311,12 @@
 						}
 					} 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 @@
 							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;
 						}


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