From 724ad0d89381456771c672b68b72bb07042b2173 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 10 Sep 2011 01:12:34 -0700 Subject: Add an option to trap context errors in a debugger --- Alc/ALc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index 339b5907..757514a3 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -34,6 +34,7 @@ #include "alSource.h" #include "alBuffer.h" #include "alAuxEffectSlot.h" +#include "alError.h" #include "bs2b.h" #include "alu.h" @@ -498,6 +499,10 @@ static void alc_init(void) if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) ZScale = -1.0; + str = getenv("__ALSOFT_TRAP_AL_ERROR"); + if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) + TrapALError = AL_TRUE; + pthread_key_create(&LocalContext, ReleaseThreadCtx); InitializeCriticalSection(&ListLock); ThunkInit(); @@ -569,6 +574,9 @@ static void alc_initconfig(void) if(DefaultResampler >= RESAMPLER_MAX || DefaultResampler <= RESAMPLER_MIN) DefaultResampler = RESAMPLER_DEFAULT; + if(!TrapALError) + TrapALError = GetConfigValueBool(NULL, "trap-al-error", AL_FALSE); + ReverbBoost *= aluPow(10.0f, GetConfigValueFloat("reverb", "boost", 0.0f) / 20.0f); EmulateEAXReverb = GetConfigValueBool("reverb", "emulate-eax", AL_FALSE); -- cgit v1.2.3