summaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-07 03:54:46 -0700
committerChris Robinson <[email protected]>2011-05-07 03:54:46 -0700
commitdb3cb23c1d9508337852b1f9ca29bc74b6725e9f (patch)
tree30af40ee360638c2c56dc12291c3280ce188c302 /Alc/ALc.c
parent7972f7a2da68fdb3ecedf34616d6b2b01dee80de (diff)
Add an option to reverse Z panning of mono sources
Applications that are not built around OpenAL's orientation system need to convert their given vectors to it. Depending on how this is done, it can lead to proper stereo (left-right) panning with improper surround sound (front-back) panning, which thusly sounds correct with stereo output and incorrect with 4+ channel output. This option is intended to help fix playback of such applications on surround sound systems, without having to resort to forcing stereo output.
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index df1a3ec2..f3096b73 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -393,6 +393,9 @@ static FILE *LogFile;
// Cone scalar
ALdouble ConeScale = 0.5;
+// Localized Z scalar for mono sources
+ALdouble ZScale = 1.0;
+
///////////////////////////////////////////////////////
@@ -466,6 +469,10 @@ static void alc_init(void)
if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
ConeScale = 1.0;
+ str = getenv("__ALSOFT_REVERSE_Z");
+ if(str && (strcasecmp(str, "true") == 0 || strtol(str, NULL, 0) == 1))
+ ZScale = -1.0;
+
InitializeCriticalSection(&g_csMutex);
ALTHUNK_INIT();
ReadALConfig();