aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c8
-rw-r--r--Alc/alcDedicated.c2
-rw-r--r--Alc/alcEcho.c4
-rw-r--r--Alc/alcReverb.c4
-rw-r--r--Alc/panning.c4
-rw-r--r--OpenAL32/Include/alu.h2
6 files changed, 12 insertions, 12 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 54d2a3e5..69a06cae 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -206,8 +206,8 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
DryGain *= aluSqrt(2.0f/4.0f);
for(c = 0;c < 2;c++)
{
- pos = aluCart2LUTpos(aluCos(RearMap[c].angle),
- aluSin(RearMap[c].angle));
+ pos = aluCart2LUTpos(aluSin(RearMap[c].angle),
+ aluCos(RearMap[c].angle));
ChannelGain = Device->PanningLUT[pos];
for(i = 0;i < (ALint)Device->NumChan;i++)
@@ -299,7 +299,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
SrcMatrix[c][LFE] += DryGain;
continue;
}
- pos = aluCart2LUTpos(aluCos(chans[c].angle), aluSin(chans[c].angle));
+ pos = aluCart2LUTpos(aluSin(chans[c].angle), aluCos(chans[c].angle));
ChannelGain = Device->PanningLUT[pos];
for(i = 0;i < (ALint)Device->NumChan;i++)
@@ -761,7 +761,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
Position[2] *= invlen;
}
- pos = aluCart2LUTpos(-Position[2]*ZScale, Position[0]);
+ pos = aluCart2LUTpos(Position[0], -Position[2]*ZScale);
ChannelGain = Device->PanningLUT[pos];
/* Adjustment for partial panning. Not the greatest, but simple
diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c
index 5bd22a72..9f331e8e 100644
--- a/Alc/alcDedicated.c
+++ b/Alc/alcDedicated.c
@@ -64,7 +64,7 @@ static ALvoid DedicatedUpdate(ALeffectState *effect, ALCdevice *device, const AL
if(Slot->effect.type == AL_EFFECT_DEDICATED_DIALOGUE)
{
- pos = aluCart2LUTpos(1.0f, 0.0f);
+ pos = aluCart2LUTpos(0.0f, 1.0f);
ChannelGain = device->PanningLUT[pos];
for(s = 0;s < MAXCHANNELS;s++)
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c
index 150720a6..2448397c 100644
--- a/Alc/alcEcho.c
+++ b/Alc/alcEcho.c
@@ -122,7 +122,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCdevice *Device, const ALeffec
dirGain = aluFabs(lrpan);
/* First tap panning */
- pos = aluCart2LUTpos(0.0f, ((lrpan>0.0f)?-1.0f:1.0f));
+ pos = aluCart2LUTpos(((lrpan>0.0f)?-1.0f:1.0f), 0.0f);
ChannelGain = Device->PanningLUT[pos];
for(i = 0;i < Device->NumChan;i++)
@@ -132,7 +132,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCdevice *Device, const ALeffec
}
/* Second tap panning */
- pos = aluCart2LUTpos(0.0f, ((lrpan>0.0f)?1.0f:-1.0f));
+ pos = aluCart2LUTpos(((lrpan>0.0f)?1.0f:-1.0f), 0.0f);
ChannelGain = Device->PanningLUT[pos];
for(i = 0;i < Device->NumChan;i++)
diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c
index f11b4ee4..b5c85999 100644
--- a/Alc/alcReverb.c
+++ b/Alc/alcReverb.c
@@ -1053,7 +1053,7 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection
* approximation of the expansion of sound across the speakers from the
* panning direction.
*/
- pos = aluCart2LUTpos(earlyPan[2], earlyPan[0]);
+ pos = aluCart2LUTpos(earlyPan[0], earlyPan[2]);
ChannelGain = Device->PanningLUT[pos];
dirGain = aluSqrt((earlyPan[0] * earlyPan[0]) + (earlyPan[2] * earlyPan[2]));
@@ -1066,7 +1066,7 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection
}
- pos = aluCart2LUTpos(latePan[2], latePan[0]);
+ pos = aluCart2LUTpos(latePan[0], latePan[2]);
ChannelGain = Device->PanningLUT[pos];
dirGain = aluSqrt((latePan[0] * latePan[0]) + (latePan[2] * latePan[2]));
diff --git a/Alc/panning.c b/Alc/panning.c
index 3d82f9fe..0e09bc5c 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -150,10 +150,10 @@ static ALfloat aluLUTpos2Angle(ALint pos)
return aluAtan((ALfloat)(pos - 3 * QUADRANT_NUM) / (ALfloat)(4 * QUADRANT_NUM - pos)) - F_PI_2;
}
-ALint aluCart2LUTpos(ALfloat re, ALfloat im)
+ALint aluCart2LUTpos(ALfloat im, ALfloat re)
{
ALint pos = 0;
- ALfloat denom = aluFabs(re) + aluFabs(im);
+ ALfloat denom = aluFabs(im) + aluFabs(re);
if(denom > 0.0f)
pos = (ALint)(QUADRANT_NUM*aluFabs(im) / denom + 0.5);
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 5345c286..9d1eb81b 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -296,7 +296,7 @@ static __inline void aluNormalize(ALfloat *inVector)
ALvoid aluInitPanning(ALCdevice *Device);
-ALint aluCart2LUTpos(ALfloat re, ALfloat im);
+ALint aluCart2LUTpos(ALfloat im, ALfloat re);
ALvoid CalcSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);
ALvoid CalcNonAttnSourceParams(struct ALsource *ALSource, const ALCcontext *ALContext);