diff options
-rw-r--r-- | Alc/ALu.c | 12 | ||||
-rw-r--r-- | OpenAL32/Include/alSource.h | 7 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 12 |
3 files changed, 16 insertions, 15 deletions
@@ -347,12 +347,12 @@ ALvoid CalcNonAttnSourceParams(ALactivesource *src, const ALCcontext *ALContext) /* Calculate gains */ DryGain = clampf(SourceVolume, MinVolume, MaxVolume); - DryGain *= ALSource->DirectGain * ListenerGain; - DryGainHF = ALSource->DirectGainHF; + DryGain *= ALSource->Direct.Gain * ListenerGain; + DryGainHF = ALSource->Direct.GainHF; for(i = 0;i < NumSends;i++) { - WetGain[i] = clampf(SourceVolume, MinVolume, MaxVolume); - WetGain[i] *= ALSource->Send[i].Gain * ListenerGain; + WetGain[i] = clampf(SourceVolume, MinVolume, MaxVolume); + WetGain[i] *= ALSource->Send[i].Gain * ListenerGain; WetGainHF[i] = ALSource->Send[i].GainHF; } @@ -873,8 +873,8 @@ ALvoid CalcSourceParams(ALactivesource *src, const ALCcontext *ALContext) WetGain[i] = clampf(WetGain[i], MinVolume, MaxVolume); /* Apply gain and frequency filters */ - DryGain *= ALSource->DirectGain * ListenerGain; - DryGainHF *= ALSource->DirectGainHF; + DryGain *= ALSource->Direct.Gain * ListenerGain; + DryGainHF *= ALSource->Direct.GainHF; for(i = 0;i < NumSends;i++) { WetGain[i] *= ALSource->Send[i].Gain * ListenerGain; diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h index c87eaa3d..4a5830a6 100644 --- a/OpenAL32/Include/alSource.h +++ b/OpenAL32/Include/alSource.h @@ -105,9 +105,10 @@ typedef struct ALsource { ALuint SampleSize; /** Direct filter and auxiliary send info. */ - ALfloat DirectGain; - ALfloat DirectGainHF; - + struct { + ALfloat Gain; + ALfloat GainHF; + } Direct; struct { struct ALeffectslot *Slot; ALfloat Gain; diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 456ab7ca..8d7ab5e6 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -661,13 +661,13 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p LockContext(Context); if(!filter) { - Source->DirectGain = 1.0f; - Source->DirectGainHF = 1.0f; + Source->Direct.Gain = 1.0f; + Source->Direct.GainHF = 1.0f; } else { - Source->DirectGain = filter->Gain; - Source->DirectGainHF = filter->GainHF; + Source->Direct.Gain = filter->Gain; + Source->Direct.GainHF = filter->GainHF; } UnlockContext(Context); Source->NeedsUpdate = AL_TRUE; @@ -2301,8 +2301,8 @@ static ALvoid InitSourceParams(ALsource *Source) Source->queue = NULL; Source->current_buffer = NULL; - Source->DirectGain = 1.0f; - Source->DirectGainHF = 1.0f; + Source->Direct.Gain = 1.0f; + Source->Direct.GainHF = 1.0f; for(i = 0;i < MAX_SENDS;i++) { Source->Send[i].Gain = 1.0f; |