diff options
author | Chris Robinson <[email protected]> | 2014-07-06 03:27:39 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-06 03:27:39 -0700 |
commit | d0a64fe191aabe085cabe1737c44ff6a47a3d4d8 (patch) | |
tree | a22024a773333fd6beb4e1af95af5497477045bd /OpenAL32 | |
parent | 5de7271bcd4df9a26301a37ed9cf76ddc6641328 (diff) |
Don't require pre-declaring vector types
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alMain.h | 6 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 8cd270d7..e9ac28e4 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -720,10 +720,6 @@ struct ALCdevice_struct #define MIXER_THREAD_NAME "alsoft-mixer" -typedef struct ALeffectslot *ALeffectslotPtr; -DECL_VECTOR(ALeffectslotPtr) - - struct ALCcontext_struct { RefCount ref; @@ -749,7 +745,7 @@ struct ALCcontext_struct ALsizei ActiveSourceCount; ALsizei MaxActiveSources; - vector_ALeffectslotPtr ActiveAuxSlots; + VECTOR(struct ALeffectslot*) ActiveAuxSlots; ALCdevice *Device; const ALCchar *ExtensionList; diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 9f554cb0..ca1e1237 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -35,7 +35,7 @@ extern inline struct ALeffectslot *LookupEffectSlot(ALCcontext *context, ALuint id); extern inline struct ALeffectslot *RemoveEffectSlot(ALCcontext *context, ALuint id); -static ALenum AddEffectSlotArray(ALCcontext *Context, const_vector_ALeffectslotPtr slots); +static ALenum AddEffectSlotArray(ALCcontext *Context, ALeffectslot **start, ALsizei count); static void RemoveEffectSlotArray(ALCcontext *Context, const ALeffectslot *slot); @@ -52,7 +52,7 @@ static inline ALeffectStateFactory *getFactoryByType(ALenum type) AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) { ALCcontext *context; - vector_ALeffectslotPtr slotvec; + VECTOR(ALeffectslot*) slotvec; ALsizei cur; ALenum err; @@ -94,7 +94,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo effectslots[cur] = slot->id; } - err = AddEffectSlotArray(context, slotvec); + err = AddEffectSlotArray(context, VECTOR_ITER_BEGIN(slotvec), n); if(err != AL_NO_ERROR) { alDeleteAuxiliaryEffectSlots(cur, effectslots); @@ -385,13 +385,12 @@ done: } -static ALenum AddEffectSlotArray(ALCcontext *context, const_vector_ALeffectslotPtr slots) +static ALenum AddEffectSlotArray(ALCcontext *context, ALeffectslot **start, ALsizei count) { ALenum err = AL_NO_ERROR; LockContext(context); - if(!VECTOR_INSERT(context->ActiveAuxSlots, VECTOR_ITER_END(context->ActiveAuxSlots), - VECTOR_ITER_BEGIN(slots), VECTOR_ITER_END(slots))) + if(!VECTOR_INSERT(context->ActiveAuxSlots, VECTOR_ITER_END(context->ActiveAuxSlots), start, start+count)) err = AL_OUT_OF_MEMORY; UnlockContext(context); |