summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-12-08 14:18:07 -0800
committerChris Robinson <[email protected]>2009-12-08 14:18:07 -0800
commit84d2d623b644880eb4d677d45e257ffb00f6244c (patch)
tree67702ebf113415bbc3a95361d122c2b41fdb32f3 /Alc/ALc.c
parent1694e5bd12d021169cf6cf541c5a5d0c652c8989 (diff)
Add a head-dampening option
This simulates occlusion of the player's head for sounds coming from behind, when outputing to mono or stereo
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 383e2c47..3f4fb706 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1711,6 +1711,15 @@ ALCAPI ALCdevice* ALCAPIENTRY alcOpenDevice(const ALCchar *deviceName)
device->Bs2bLevel = GetConfigValueInt(NULL, "cf_level", 0);
+ if(aluChannelsFromFormat(device->Format) <= 2)
+ {
+ device->HeadDampen = GetConfigValueFloat(NULL, "head_dampen", DEFAULT_HEAD_DAMPEN);
+ device->HeadDampen = __min(device->HeadDampen, 1.0f);
+ device->HeadDampen = __max(device->HeadDampen, 0.0f);
+ }
+ else
+ device->HeadDampen = 0.0f;
+
// Find a playback device to open
SuspendContext(NULL);
for(i = 0;BackendList[i].Init;i++)