diff options
author | Chris Robinson <[email protected]> | 2012-04-29 03:39:08 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2012-04-29 03:39:08 -0700 |
commit | 57d36ec5826389984cbd5998ab487d8655adabdb (patch) | |
tree | 3fc82ca115b5ff1f4d9cd2d0a94fc9a5666e8ec4 /Alc/panning.c | |
parent | febc2a50cb1a860d11b6b740bd05a555fce5a8d2 (diff) |
Fix a couple comment typos, and a minor cleanup
Diffstat (limited to 'Alc/panning.c')
-rw-r--r-- | Alc/panning.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Alc/panning.c b/Alc/panning.c index 8a53047a..288f44d1 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -197,7 +197,7 @@ ALvoid ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, } if(hwidth <= 0.0f) { - /* Infinitismally small sound point. */ + /* Infinitely small sound point. */ for(i = 0;i < device->NumChan-1;i++) { if(angle >= SpeakerAngle[i] && angle < SpeakerAngle[i+1]) @@ -220,20 +220,11 @@ ALvoid ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, return; } - if(aluFabs(angle)+hwidth <= F_PI) - { - /* Good, the coverage area ins fully inside -pi...+pi. */ - langle = angle-hwidth; - rangle = angle+hwidth; - } - else + if(aluFabs(angle)+hwidth > F_PI) { /* The coverage area would go outside of -pi...+pi. Instead, rotate the - * speaker angles so it was be as if angle=0, and keep them wrapped + * speaker angles so it would be as if angle=0, and keep them wrapped * within -pi...+pi. */ - langle = -hwidth; - rangle = +hwidth; - for(i = 0;i < device->NumChan;i++) { SpeakerAngle[i] -= angle; @@ -242,6 +233,7 @@ ALvoid ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, else if(SpeakerAngle[i] < -F_PI) SpeakerAngle[i] += F_PI*2.0f; } + angle = 0.0f; /* The speaker angles are expected to be in ascending order. There * should be a better way to resort the lists... */ @@ -271,6 +263,8 @@ ALvoid ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat hwidth, } } } + langle = angle - hwidth; + rangle = angle + hwidth; /* First speaker */ i = 0; |