Igor Kotrasinski : dsound: Fix conning formula to correctly interpolate volume.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Apr 14 08:31:57 CDT 2015


Module: wine
Branch: master
Commit: 65e19a096d911a0a7ee2329d2c8f110fb0008f5e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=65e19a096d911a0a7ee2329d2c8f110fb0008f5e

Author: Igor Kotrasinski <ikk_pl at yahoo.co.uk>
Date:   Sat Apr 11 15:44:14 2015 +0000

dsound: Fix conning formula to correctly interpolate volume.

---

 dlls/dsound/sound3d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dsound/sound3d.c b/dlls/dsound/sound3d.c
index ffd4d45..5eb02a6 100644
--- a/dlls/dsound/sound3d.c
+++ b/dlls/dsound/sound3d.c
@@ -242,7 +242,7 @@ void DSOUND_Calc3DBuffer(IDirectSoundBufferImpl *dsb)
 			if (flAngle > dwOutsideConeAngle)
 				flAngle = dwOutsideConeAngle;
 			/* this probably isn't the right thing, but it's ok for the time being */
-			lVolume += ((dsb->ds3db_ds3db.lConeOutsideVolume)/((dwOutsideConeAngle) - (dwInsideConeAngle))) * flAngle;
+			lVolume += ((flAngle - dwInsideConeAngle)/(dwOutsideConeAngle - dwInsideConeAngle)) * dsb->ds3db_ds3db.lConeOutsideVolume;
 		}
 		TRACE("conning: Angle = %f deg; InsideConeAngle(/2) = %d deg; OutsideConeAngle(/2) = %d deg; ConeOutsideVolume = %d => adjusting volume to %f\n",
 		       flAngle, dsb->ds3db_ds3db.dwInsideConeAngle/2, dsb->ds3db_ds3db.dwOutsideConeAngle/2, dsb->ds3db_ds3db.lConeOutsideVolume, lVolume);




More information about the wine-cvs mailing list