aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-03-20 00:54:44 -0700
committerChris Robinson <[email protected]>2010-03-20 00:54:44 -0700
commiteea23a012a12bad9ece850967c9dfbbd3f5e5c73 (patch)
treeaad04735e3a755206d16751d3729d32d6b5fb047
parent2235a53824df44c03b51ec54ba4237618be7fc45 (diff)
Relax circular layout requirement
-rw-r--r--Alc/ALu.c26
-rw-r--r--alsoftrc.sample6
2 files changed, 23 insertions, 9 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 47d109dd..e35d8734 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -188,13 +188,29 @@ static ALvoid SetSpeakerArrangement(const char *name, ALfloat SpeakerAngle[OUTPU
}
}
- for(i = 1;i < chans;i++)
+ for(i = 0;i < chans;i++)
{
- if(SpeakerAngle[i] <= SpeakerAngle[i-1])
+ int min = i;
+ int i2;
+
+ for(i2 = i+1;i2 < chans;i2++)
+ {
+ if(SpeakerAngle[i2] < SpeakerAngle[min])
+ min = i2;
+ }
+
+ if(min != i)
{
- AL_PRINT("Speaker %d of %d does not follow previous: %f > %f\n", i, chans,
- SpeakerAngle[i-1] * 180.0f/M_PI, SpeakerAngle[i] * 180.0f/M_PI);
- SpeakerAngle[i] = SpeakerAngle[i-1] + 1 * M_PI/180.0f;
+ ALfloat tmpf;
+ ALint tmpi;
+
+ tmpf = SpeakerAngle[i];
+ SpeakerAngle[i] = SpeakerAngle[min];
+ SpeakerAngle[min] = tmpf;
+
+ tmpi = Speaker2Chan[i];
+ Speaker2Chan[i] = Speaker2Chan[min];
+ Speaker2Chan[min] = tmpi;
}
}
}
diff --git a/alsoftrc.sample b/alsoftrc.sample
index 2c07209a..9fcee641 100644
--- a/alsoftrc.sample
+++ b/alsoftrc.sample
@@ -132,10 +132,8 @@
## layout_STEREO:
# Sets the speaker layout when using stereo output. Values are specified in
# degrees, where 0 is straight in front, negative goes left, and positive goes
-# right. The values must define a circular pattern, starting with the back-
-# left at the most negative, around the front to back-center. Unspecified
-# speakers will remain at their default position. Available speakers are
-# front-left(fl) and front-right(fr).
+# right. Unspecified speakers will remain at their default position. Available
+# speakers are front-left(fl) and front-right(fr).
#layout_STEREO = fl=-90, fr=90
## laytout_QUAD: