diff options
author | Chris Robinson <[email protected]> | 2018-01-27 17:24:18 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-27 19:04:32 -0800 |
commit | 6a839600b96b73104f8b93a4fa4a1a8da67cae5c (patch) | |
tree | 5b5203ce907411f32999e2e3ee3e3cd2a39dda25 /OpenAL32/Include | |
parent | 4d1795e90b83f040aa59cf69616a4ff2b32bf71a (diff) |
Use a vector to store the effect slot pointers
And make the ID a simple index into it (1-base, to avoid ID 0).
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 14 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 9 |
2 files changed, 8 insertions, 15 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index 74bb841c..e4e954a0 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -149,20 +149,6 @@ typedef struct ALeffectslot { alignas(16) ALfloat WetBuffer[MAX_EFFECT_CHANNELS][BUFFERSIZE]; } ALeffectslot; -inline void LockEffectSlotsRead(ALCcontext *context) -{ LockUIntMapRead(&context->EffectSlotMap); } -inline void UnlockEffectSlotsRead(ALCcontext *context) -{ UnlockUIntMapRead(&context->EffectSlotMap); } -inline void LockEffectSlotsWrite(ALCcontext *context) -{ LockUIntMapWrite(&context->EffectSlotMap); } -inline void UnlockEffectSlotsWrite(ALCcontext *context) -{ UnlockUIntMapWrite(&context->EffectSlotMap); } - -inline struct ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id) -{ return (struct ALeffectslot*)LookupUIntMapKeyNoLock(&context->EffectSlotMap, id); } -inline struct ALeffectslot *RemoveEffectSlot(ALCcontext *context, ALuint id) -{ return (struct ALeffectslot*)RemoveUIntMapKeyNoLock(&context->EffectSlotMap, id); } - ALenum InitEffectSlot(ALeffectslot *slot); void DeinitEffectSlot(ALeffectslot *slot); void UpdateEffectSlotProps(ALeffectslot *slot, ALCcontext *context); diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index f7ae2ecd..d1ae0a94 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -387,6 +387,12 @@ typedef struct SourceSubList { } SourceSubList; TYPEDEF_VECTOR(SourceSubList, vector_SourceSubList) +/* Effect slots are rather large, and apps aren't likely to have more than one + * or two (let alone 64), so hold them individually. + */ +typedef struct ALeffectslot *ALeffectslotPtr; +TYPEDEF_VECTOR(ALeffectslotPtr, vector_ALeffectslotPtr) + typedef struct EnumeratedHrtf { al_string name; @@ -600,7 +606,8 @@ struct ALCcontext_struct { ALuint NumSources; almtx_t SourceLock; - UIntMap EffectSlotMap; + vector_ALeffectslotPtr EffectSlotList; + almtx_t EffectSlotLock; ATOMIC(ALenum) LastError; |