aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-30 20:13:42 -0700
committerChris Robinson <[email protected]>2011-08-30 20:13:42 -0700
commit189add1d5a5b1f9f55fba63937f3d92cddc0cea2 (patch)
tree202a765e0355e2702d9eb9d17ee9200814bf4c21 /Alc/ALu.c
parent755062fb76148d740681eb33046f8f2a7729eab3 (diff)
Use a separate array for the auxiliary slots in the mixer
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index ae950f32..f2658da7 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -949,12 +949,11 @@ DECL_TEMPLATE(ALbyte)
ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
{
ALuint SamplesToDo;
- ALeffectslot *ALEffectSlot;
+ ALeffectslot **slot, **slot_end;
ALsource **src, **src_end;
ALCcontext *ctx;
int fpuState;
ALuint i, c;
- ALsizei e;
#if defined(HAVE_FESETROUND)
fpuState = fegetround();
@@ -1004,30 +1003,31 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
}
/* effect slot processing */
- for(e = 0;e < ctx->EffectSlotMap.size;e++)
+ slot = ctx->ActiveEffectSlots;
+ slot_end = slot + ctx->ActiveEffectSlotCount;
+ while(slot != slot_end)
{
- ALEffectSlot = ctx->EffectSlotMap.array[e].value;
-
for(i = 0;i < SamplesToDo;i++)
{
- ALEffectSlot->WetBuffer[i] += ALEffectSlot->ClickRemoval[0];
- ALEffectSlot->ClickRemoval[0] -= ALEffectSlot->ClickRemoval[0] / 256.0f;
+ (*slot)->WetBuffer[i] += (*slot)->ClickRemoval[0];
+ (*slot)->ClickRemoval[0] -= (*slot)->ClickRemoval[0] / 256.0f;
}
for(i = 0;i < 1;i++)
{
- ALEffectSlot->ClickRemoval[i] += ALEffectSlot->PendingClicks[i];
- ALEffectSlot->PendingClicks[i] = 0.0f;
+ (*slot)->ClickRemoval[i] += (*slot)->PendingClicks[i];
+ (*slot)->PendingClicks[i] = 0.0f;
}
- if(!DeferUpdates && ExchangeInt(&ALEffectSlot->NeedsUpdate, AL_FALSE))
- ALEffect_Update(ALEffectSlot->EffectState, ctx, ALEffectSlot);
+ if(!DeferUpdates && ExchangeInt(&(*slot)->NeedsUpdate, AL_FALSE))
+ ALEffect_Update((*slot)->EffectState, ctx, *slot);
- ALEffect_Process(ALEffectSlot->EffectState, ALEffectSlot,
- SamplesToDo, ALEffectSlot->WetBuffer,
- device->DryBuffer);
+ ALEffect_Process((*slot)->EffectState, *slot, SamplesToDo,
+ (*slot)->WetBuffer, device->DryBuffer);
for(i = 0;i < SamplesToDo;i++)
- ALEffectSlot->WetBuffer[i] = 0.0f;
+ (*slot)->WetBuffer[i] = 0.0f;
+
+ slot++;
}
ctx = ctx->next;