diff options
author | Chris Robinson <[email protected]> | 2009-12-08 14:18:07 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-12-08 14:18:07 -0800 |
commit | 84d2d623b644880eb4d677d45e257ffb00f6244c (patch) | |
tree | 67702ebf113415bbc3a95361d122c2b41fdb32f3 /Alc/ALc.c | |
parent | 1694e5bd12d021169cf6cf541c5a5d0c652c8989 (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.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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++) |