summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-18 15:10:21 -0800
committerChris Robinson <[email protected]>2007-12-18 15:10:21 -0800
commitbdf16bf601ed1cedc652af62029d4cbd91e90c09 (patch)
tree497077515488ddbc3937d49e0ced644ae401a7f5
parentcf03bfa1565db202c72e2c09ba9d32fd89c0f3b5 (diff)
Add initial auxiliary send paths
-rw-r--r--Alc/ALu.c23
-rw-r--r--OpenAL32/Include/alSource.h6
2 files changed, 23 insertions, 6 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b65070a8..061f87a1 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -378,6 +378,14 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource,
break;
}
+ switch(ALSource->Send[0].WetFilter.filter)
+ {
+ case AL_FILTER_LOWPASS:
+ WetMix *= ALSource->Send[0].WetFilter.Gain;
+ WetGainHF *= ALSource->Send[0].WetFilter.GainHF;
+ break;
+ }
+
if(ALSource->AirAbsorptionFactor > 0.0f)
DryGainHF *= pow(ALSource->AirAbsorptionFactor * AIRABSORBGAINHF,
Distance * MetersPerUnit);
@@ -576,12 +584,15 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
DryBuffer[j][2] += value*DrySend[2];
DryBuffer[j][3] += value*DrySend[3];
- //Room path final mix buffer and panning
- value = aluComputeWetSample(ALSource, WetGainHF, sample);
- WetBuffer[j][0] += value*WetSend[0];
- WetBuffer[j][1] += value*WetSend[1];
- WetBuffer[j][2] += value*WetSend[2];
- WetBuffer[j][3] += value*WetSend[3];
+ if(ALSource->Send[0].Slot.effectslot)
+ {
+ //Room path final mix buffer and panning
+ value = aluComputeWetSample(ALSource, WetGainHF, sample);
+ WetBuffer[j][0] += value*WetSend[0];
+ WetBuffer[j][1] += value*WetSend[1];
+ WetBuffer[j][2] += value*WetSend[2];
+ WetBuffer[j][3] += value*WetSend[3];
+ }
}
else
{
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
index 38b0094d..1ada61df 100644
--- a/OpenAL32/Include/alSource.h
+++ b/OpenAL32/Include/alSource.h
@@ -4,6 +4,7 @@
#define AL_NUM_SOURCE_PARAMS 128
#include "alFilter.h"
+#include "alAuxEffectSlot.h"
#include "AL/al.h"
#define AL_DIRECT_FILTER 0x20005
@@ -62,6 +63,11 @@ typedef struct ALsource_struct
ALfilter DirectFilter;
+ struct {
+ ALeffectslot Slot;
+ ALfilter WetFilter;
+ } Send[1];
+
ALfloat LastDrySample;
ALfloat LastWetSample;