From 75222892be25a68fa371ad69ab741c0674502997 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 21 Dec 2014 18:57:30 +0100 Subject: [PATCH] cleaned up few things --- src/engine/client/sound.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp index fd583de03..ad4ff232b 100644 --- a/src/engine/client/sound.cpp +++ b/src/engine/client/sound.cpp @@ -59,7 +59,7 @@ static LOCK m_SoundLock = 0; static int m_CenterX = 0; static int m_CenterY = 0; -static int m_MaxDistance = 1500; +static float m_MaxDistance = 1500.0f; static int m_MixingRate = 48000; static volatile int m_SoundVolume = 100; @@ -78,13 +78,6 @@ static short Int2Short(int i) return i; } -static int IntAbs(int i) -{ - if(i<0) - return -i; - return i; -} - static void Mix(short *pFinalOut, unsigned Frames) { int MasterVol; @@ -142,8 +135,8 @@ static void Mix(short *pFinalOut, unsigned Frames) // linear falloff float Falloff = 1.0f - Dist/m_MaxDistance; - Lvol = (int)Lvol*Lgain*Falloff; - Rvol = (int)Rvol*Rgain*Falloff; + Lvol = Lvol*Lgain*Falloff; + Rvol = Rvol*Rgain*Falloff; } else {