aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c8
-rw-r--r--Alc/panning.c14
2 files changed, 11 insertions, 11 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index d2c2ec19..bc48dd59 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -683,8 +683,8 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALsourceProps *
/* Clamp X so it remains within 30 degrees of 0 or 180 degree azimuth. */
ALfloat x = sinf(chans[c].angle) * cosf(chans[c].elevation);
coeffs[0] = clampf(-x, -0.5f, 0.5f) + 0.5f;
- voice->Direct.Params[c].Gains.Target[0] = coeffs[0] * DryGain;
- voice->Direct.Params[c].Gains.Target[1] = (1.0f-coeffs[0]) * DryGain;
+ voice->Direct.Params[c].Gains.Target[0] = sqrtf(coeffs[0]) * DryGain;
+ voice->Direct.Params[c].Gains.Target[1] = sqrtf(1.0f-coeffs[0]) * DryGain;
for(j = 2;j < MAX_OUTPUT_CHANNELS;j++)
voice->Direct.Params[c].Gains.Target[j] = 0.0f;
@@ -1176,8 +1176,8 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALsourceProps *pro
/* Clamp X so it remains within 30 degrees of 0 or 180 degree azimuth. */
ALfloat x = -dir[0] * (0.5f * (cosf(spread*0.5f) + 1.0f));
x = clampf(x, -0.5f, 0.5f) + 0.5f;
- voice->Direct.Params[0].Gains.Target[0] = x * DryGain;
- voice->Direct.Params[0].Gains.Target[1] = (1.0f-x) * DryGain;
+ voice->Direct.Params[0].Gains.Target[0] = sqrtf(x) * DryGain;
+ voice->Direct.Params[0].Gains.Target[1] = sqrtf(1.0f-x) * DryGain;
for(i = 2;i < MAX_OUTPUT_CHANNELS;i++)
voice->Direct.Params[0].Gains.Target[i] = 0.0f;
diff --git a/Alc/panning.c b/Alc/panning.c
index 70355b41..72b55792 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -1143,6 +1143,8 @@ void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf
no_hrtf:
TRACE("HRTF disabled\n");
+ device->Render_Mode = StereoPair;
+
ambiup_free(device->AmbiUp);
device->AmbiUp = NULL;
@@ -1154,7 +1156,6 @@ no_hrtf:
{
device->Bs2b = al_calloc(16, sizeof(*device->Bs2b));
bs2b_set_params(device->Bs2b, bs2blevel, device->Frequency);
- device->Render_Mode = StereoPair;
TRACE("BS2B enabled\n");
InitPanning(device);
return;
@@ -1162,13 +1163,12 @@ no_hrtf:
TRACE("BS2B disabled\n");
- device->Render_Mode = NormalRender;
- if(ConfigValueStr(al_string_get_cstr(device->DeviceName), NULL, "stereo-panning", &mode))
+ if(ConfigValueStr(al_string_get_cstr(device->DeviceName), NULL, "stereo-encoding", &mode))
{
- if(strcasecmp(mode, "paired") == 0)
- device->Render_Mode = StereoPair;
- else if(strcasecmp(mode, "uhj") != 0)
- ERR("Unexpected stereo-panning: %s\n", mode);
+ if(strcasecmp(mode, "uhj") == 0)
+ device->Render_Mode = NormalRender;
+ else if(strcasecmp(mode, "panpot") != 0)
+ ERR("Unexpected stereo-encoding: %s\n", mode);
}
if(device->Render_Mode == NormalRender)
{