From f6a1e53f191212112a5c31803c7018387d8aa715 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 16 Apr 2012 20:13:50 -0700 Subject: Read ALSOFT_TRAP_*ERROR when reading the config --- Alc/ALc.c | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) (limited to 'Alc') diff --git a/Alc/ALc.c b/Alc/ALc.c index 52ba6801..c752d186 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -498,23 +498,6 @@ static void alc_init(void) if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) ZScale = -1.0f; - str = getenv("ALSOFT_TRAP_ERROR"); - if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) - { - TrapALError = AL_TRUE; - TrapALCError = AL_TRUE; - } - else - { - str = getenv("ALSOFT_TRAP_AL_ERROR"); - if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) - TrapALError = AL_TRUE; - - str = getenv("ALSOFT_TRAP_ALC_ERROR"); - if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) - TrapALCError = ALC_TRUE; - } - pthread_key_create(&LocalContext, ReleaseThreadCtx); InitializeCriticalSection(&ListLock); ThunkInit(); @@ -605,11 +588,24 @@ static void alc_initconfig(void) } } - if(!TrapALCError) - TrapALCError = GetConfigValueBool(NULL, "trap-alc-error", ALC_FALSE); + str = getenv("ALSOFT_TRAP_ERROR"); + if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) + { + TrapALError = AL_TRUE; + TrapALCError = AL_TRUE; + } + else + { + str = getenv("ALSOFT_TRAP_AL_ERROR"); + if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) + TrapALError = AL_TRUE; + TrapALError = GetConfigValueBool(NULL, "trap-al-error", TrapALError); - if(!TrapALError) - TrapALError = GetConfigValueBool(NULL, "trap-al-error", AL_FALSE); + str = getenv("ALSOFT_TRAP_ALC_ERROR"); + if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1)) + TrapALCError = ALC_TRUE; + TrapALCError = GetConfigValueBool(NULL, "trap-alc-error", TrapALCError); + } if(ConfigValueFloat("reverb", "boost", &valf)) ReverbBoost *= aluPow(10.0f, valf / 20.0f); -- cgit v1.2.3