aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2010-05-12 02:20:14 -0700
committerChris Robinson <[email protected]>2010-05-12 02:20:14 -0700
commitaf4faaf6660d02ce593e07b97d05020b44ed06e4 (patch)
treeaf18189c604ec6c165084fe3c49bb1cdc2c3603f /Alc
parentf2548570b85b6deaba57f1bfa2ded87bf2f42886 (diff)
Use a UIntMap for the effect slot list
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c9
-rw-r--r--Alc/ALu.c6
2 files changed, 8 insertions, 7 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 2a3c9016..5560e6e7 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1513,12 +1513,12 @@ ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCin
for(i = 0;i < device->NumContexts;i++)
{
ALCcontext *context = device->Contexts[i];
- ALeffectslot *slot;
ALsizei pos;
SuspendContext(context);
- for(slot = context->EffectSlotList;slot != NULL;slot = slot->next)
+ for(pos = 0;pos < context->EffectSlotMap.size;pos++)
{
+ ALeffectslot *slot = context->EffectSlotMap.array[pos].value;
if(!slot->EffectState)
continue;
@@ -1649,13 +1649,14 @@ ALC_API ALCvoid ALC_APIENTRY alcDestroyContext(ALCcontext *context)
}
ResetUIntMap(&context->SourceMap);
- if(context->EffectSlotCount > 0)
+ if(context->EffectSlotMap.size > 0)
{
#ifdef _DEBUG
- AL_PRINT("alcDestroyContext(): deleting %d AuxiliaryEffectSlot(s)\n", context->EffectSlotCount);
+ AL_PRINT("alcDestroyContext(): deleting %d AuxiliaryEffectSlot(s)\n", context->EffectSlotMap.size);
#endif
ReleaseALAuxiliaryEffectSlots(context);
}
+ ResetUIntMap(&context->EffectSlotMap);
list = &g_pContextList;
while(*list != context)
diff --git a/Alc/ALu.c b/Alc/ALu.c
index d2678687..a5513985 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -1409,6 +1409,7 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
ALfloat samp;
int fpuState;
ALuint i, j, c;
+ ALsizei e;
#if defined(HAVE_FESETROUND)
fpuState = fegetround();
@@ -1438,15 +1439,14 @@ ALvoid aluMixData(ALCdevice *device, ALvoid *buffer, ALsizei size)
MixSomeSources(ALContext, DryBuffer, SamplesToDo);
/* effect slot processing */
- ALEffectSlot = ALContext->EffectSlotList;
- while(ALEffectSlot)
+ for(e = 0;e < ALContext->EffectSlotMap.size;e++)
{
+ ALEffectSlot = ALContext->EffectSlotMap.array[e].value;
if(ALEffectSlot->EffectState)
ALEffect_Process(ALEffectSlot->EffectState, ALEffectSlot, SamplesToDo, ALEffectSlot->WetBuffer, DryBuffer);
for(i = 0;i < SamplesToDo;i++)
ALEffectSlot->WetBuffer[i] = 0.0f;
- ALEffectSlot = ALEffectSlot->next;
}
ProcessContext(ALContext);
}