From 573c5e4940b9f480c91e080291c278496d214182 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Thu, 20 Apr 2023 08:03:41 +0700 Subject: [PATCH] disable ALC_HRTF_SOFT (#998) * add snd_hrtf option, set ALC_HRTF_SOFT to ALC_DONT_CARE_SOFT (taken from GZDoom) * disable HRTF, remove snd_hrtf config option Thanks to Ceski. --- src/i_sound.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/i_sound.c b/src/i_sound.c index d1fa2f28..a098fa2a 100644 --- a/src/i_sound.c +++ b/src/i_sound.c @@ -614,6 +614,11 @@ void I_InitSound(void) ALCcontext *context; ALCint srate = -1; + ALCint attribs[] = { // zero terminated list of integer pairs + ALC_HRTF_SOFT, ALC_FALSE, + 0 + }; + if (nosfxparm && nomusicparm) { return; @@ -635,7 +640,12 @@ void I_InitSound(void) return; } - context = alcCreateContext(device, NULL); + if (alcIsExtensionPresent(device, "ALC_SOFT_HRTF") == AL_FALSE) + { + attribs[0] = 0; + } + + context = alcCreateContext(device, &attribs[0]); if (!context || alcMakeContextCurrent(context) == ALC_FALSE) { fprintf(stderr, "I_InitSound: Error making context.\n");