mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
cleaned up few things
This commit is contained in:
parent
d1ee52c372
commit
75222892be
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue