aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 822189f8..14b4d134 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -492,6 +492,7 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A
{
ALfloat N[3], V[3], U[3];
aluMatrix matrix;
+ ALfloat scale;
/* AT then UP */
N[0] = ALSource->Orientation[0][0];
@@ -512,11 +513,14 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A
aluCrossproduct(N, V, U);
aluNormalize(U);
+ /* Build a rotate + channel reorder matrix (B-Format -> ACN), and
+ * include scaling for first-order content. */
+ scale = Device->AmbiScale;
aluMatrixSet(&matrix,
- 1.0f, 0.0f, 0.0f, 0.0f,
- 0.0f, -N[2], -N[0], N[1],
- 0.0f, U[2], U[0], -U[1],
- 0.0f, -V[2], -V[0], V[1]
+ 1.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, -N[0]*scale, N[1]*scale, -N[2]*scale,
+ 0.0f, U[0]*scale, -U[1]*scale, U[2]*scale,
+ 0.0f, -V[0]*scale, V[1]*scale, -V[2]*scale
);
for(c = 0;c < num_channels;c++)