diff options
author | Chris Robinson <[email protected]> | 2010-03-16 17:35:51 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-03-16 17:35:51 -0700 |
commit | f37cfc486d9f7ff84d21395f9135819f0b24f274 (patch) | |
tree | 64666af29c8814b8b8c53e4bf1d8a39cc562cb2a | |
parent | a337a59fb8c07b608944bff843b765656c56da64 (diff) |
Pass the context to alSetError
-rw-r--r-- | Alc/alcEcho.c | 6 | ||||
-rw-r--r-- | Alc/alcReverb.c | 9 | ||||
-rw-r--r-- | OpenAL32/Include/alError.h | 3 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 52 | ||||
-rw-r--r-- | OpenAL32/alBuffer.c | 172 | ||||
-rw-r--r-- | OpenAL32/alDatabuffer.c | 86 | ||||
-rw-r--r-- | OpenAL32/alEffect.c | 170 | ||||
-rw-r--r-- | OpenAL32/alError.c | 13 | ||||
-rw-r--r-- | OpenAL32/alExtension.c | 11 | ||||
-rw-r--r-- | OpenAL32/alFilter.c | 44 | ||||
-rw-r--r-- | OpenAL32/alListener.c | 44 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 168 | ||||
-rw-r--r-- | OpenAL32/alState.c | 40 |
13 files changed, 402 insertions, 416 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index ea4af8dd..69bbd386 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -81,10 +81,7 @@ ALboolean EchoDeviceUpdate(ALeffectState *effect, ALCdevice *Device) temp = realloc(state->SampleBuffer, maxlen * sizeof(ALfloat)); if(!temp) - { - alSetError(AL_OUT_OF_MEMORY); return AL_FALSE; - } state->SampleBuffer = temp; state->BufferLength = maxlen; } @@ -165,10 +162,7 @@ ALeffectState *EchoCreate(void) state = malloc(sizeof(*state)); if(!state) - { - alSetError(AL_OUT_OF_MEMORY); return NULL; - } state->state.Destroy = EchoDestroy; state->state.DeviceUpdate = EchoDeviceUpdate; diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c index 318a8401..a2b888d9 100644 --- a/Alc/alcReverb.c +++ b/Alc/alcReverb.c @@ -985,10 +985,7 @@ static ALboolean VerbDeviceUpdate(ALeffectState *effect, ALCdevice *Device) // Allocate the delay lines. if(!AllocLines(AL_FALSE, frequency, State)) - { - alSetError(AL_OUT_OF_MEMORY); return AL_FALSE; - } // The early reflection and late all-pass filter line lengths are static, // so their offsets only need to be calculated once. @@ -1013,10 +1010,7 @@ static ALboolean EAXVerbDeviceUpdate(ALeffectState *effect, ALCdevice *Device) // Allocate the delay lines. if(!AllocLines(AL_TRUE, frequency, State)) - { - alSetError(AL_OUT_OF_MEMORY); return AL_FALSE; - } // Calculate the modulation filter coefficient. Notice that the exponent // is calculated given the current sample rate. This ensures that the @@ -1225,10 +1219,7 @@ ALeffectState *VerbCreate(void) State = malloc(sizeof(ALverbState)); if(!State) - { - alSetError(AL_OUT_OF_MEMORY); return NULL; - } State->state.Destroy = VerbDestroy; State->state.DeviceUpdate = VerbDeviceUpdate; diff --git a/OpenAL32/Include/alError.h b/OpenAL32/Include/alError.h index 5cee8db8..7976e50f 100644 --- a/OpenAL32/Include/alError.h +++ b/OpenAL32/Include/alError.h @@ -2,12 +2,13 @@ #define _AL_ERROR_H_ #include "AL/al.h" +#include "AL/alc.h" #ifdef __cplusplus extern "C" { #endif -ALvoid alSetError(ALenum errorCode); +ALvoid alSetError(ALCcontext *Context, ALenum errorCode); #ifdef __cplusplus } diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 86fa96e6..d5541ed7 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -65,7 +65,7 @@ ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) // We must have run out or memory free(*list); *list = NULL; alDeleteAuxiliaryEffectSlots(i, effectslots); - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); break; } @@ -86,7 +86,7 @@ ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) } } else - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); } ProcessContext(Context); @@ -108,7 +108,7 @@ ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) { if (!alIsAuxiliaryEffectSlot(effectslots[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); break; } else @@ -116,7 +116,7 @@ ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) ALAuxiliaryEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslots[i]); if(ALAuxiliaryEffectSlot->refcount > 0) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); break; } } @@ -155,7 +155,7 @@ ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } @@ -199,7 +199,7 @@ ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint updateSources = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO: @@ -209,16 +209,16 @@ ALvoid AL_APIENTRY alAuxiliaryEffectSloti(ALuint effectslot, ALenum param, ALint updateSources = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); // Force updating the sources that use this slot, since it affects the // sending parameters @@ -260,12 +260,12 @@ ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALin break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -287,16 +287,16 @@ ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALflo if(flValue >= 0.0f && flValue <= 1.0f) ALEffectSlot->Gain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -317,12 +317,12 @@ ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, ALfl break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -349,12 +349,12 @@ ALvoid AL_APIENTRY alGetAuxiliaryEffectSloti(ALuint effectslot, ALenum param, AL break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -376,12 +376,12 @@ ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, A break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -404,12 +404,12 @@ ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, AL break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -430,12 +430,12 @@ ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, A break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -469,10 +469,7 @@ ALeffectState *NoneCreate(void) state = calloc(1, sizeof(*state)); if(!state) - { - alSetError(AL_OUT_OF_MEMORY); return NULL; - } state->Destroy = NoneDestroy; state->DeviceUpdate = NoneDeviceUpdate; @@ -501,6 +498,7 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *ALEffectSlot, { if(NewState) ALEffect_Destroy(NewState); + alSetError(Context, AL_OUT_OF_MEMORY); return; } if(ALEffectSlot->EffectState) diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 2c909653..b1c71004 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -32,7 +32,7 @@ #include "alThunk.h" -static void LoadData(ALbuffer *ALBuf, const ALubyte *data, ALsizei size, ALuint freq, ALenum OrigFormat, ALenum NewFormat); +static ALenum LoadData(ALbuffer *ALBuf, const ALubyte *data, ALsizei size, ALuint freq, ALenum OrigFormat, ALenum NewFormat); static void ConvertData(ALfloat *dst, const ALvoid *src, ALint origBytes, ALsizei len); static void ConvertDataRear(ALfloat *dst, const ALvoid *src, ALint origBytes, ALsizei len); static void ConvertDataIMA4(ALfloat *dst, const ALvoid *src, ALint origChans, ALsizei len); @@ -129,7 +129,7 @@ ALAPI ALvoid ALAPIENTRY alGenBuffers(ALsizei n,ALuint *puiBuffers) if(!(*list)) { alDeleteBuffers(i, puiBuffers); - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); break; } @@ -145,7 +145,7 @@ ALAPI ALvoid ALAPIENTRY alGenBuffers(ALsizei n,ALuint *puiBuffers) else { // Pointer does not point to enough memory to write Buffer names - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } } @@ -185,7 +185,7 @@ ALAPI ALvoid ALAPIENTRY alDeleteBuffers(ALsizei n, const ALuint *puiBuffers) if (ALBuf->refcount != 0) { // Buffer still in use, cannot be deleted - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); bFailed = AL_TRUE; } } @@ -193,7 +193,7 @@ ALAPI ALvoid ALAPIENTRY alDeleteBuffers(ALsizei n, const ALuint *puiBuffers) else { // Invalid Buffer - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bFailed = AL_TRUE; } } @@ -227,7 +227,7 @@ ALAPI ALvoid ALAPIENTRY alDeleteBuffers(ALsizei n, const ALuint *puiBuffers) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } @@ -287,6 +287,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d ALCcontext *Context; ALbuffer *ALBuf; ALvoid *temp; + ALenum err; Context = GetContextSuspended(); if(!Context) return; @@ -301,7 +302,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d if(Context->SampleSource->state == MAPPED) { - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); ProcessContext(Context); return; } @@ -318,14 +319,18 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d case AL_FORMAT_MONO16: case AL_FORMAT_MONO_FLOAT32: case AL_FORMAT_MONO_DOUBLE_EXT: - LoadData(ALBuf, data, size, freq, format, AL_FORMAT_MONO_FLOAT32); + err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_MONO_FLOAT32); + if(err != AL_NO_ERROR) + alSetError(Context, err); break; case AL_FORMAT_STEREO8: case AL_FORMAT_STEREO16: case AL_FORMAT_STEREO_FLOAT32: case AL_FORMAT_STEREO_DOUBLE_EXT: - LoadData(ALBuf, data, size, freq, format, AL_FORMAT_STEREO_FLOAT32); + err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_STEREO_FLOAT32); + if(err != AL_NO_ERROR) + alSetError(Context, err); break; case AL_FORMAT_REAR8: @@ -342,7 +347,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d if((size%(OrigBytes*2)) != 0) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -362,7 +367,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d ALBuf->frequency = freq; } else - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); } break; case AL_FORMAT_QUAD8_LOKI: @@ -370,25 +375,33 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d case AL_FORMAT_QUAD8: case AL_FORMAT_QUAD16: case AL_FORMAT_QUAD32: - LoadData(ALBuf, data, size, freq, format, AL_FORMAT_QUAD32); + err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_QUAD32); + if(err != AL_NO_ERROR) + alSetError(Context, err); break; case AL_FORMAT_51CHN8: case AL_FORMAT_51CHN16: case AL_FORMAT_51CHN32: - LoadData(ALBuf, data, size, freq, format, AL_FORMAT_51CHN32); + err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_51CHN32); + if(err != AL_NO_ERROR) + alSetError(Context, err); break; case AL_FORMAT_61CHN8: case AL_FORMAT_61CHN16: case AL_FORMAT_61CHN32: - LoadData(ALBuf, data, size, freq, format, AL_FORMAT_61CHN32); + err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_61CHN32); + if(err != AL_NO_ERROR) + alSetError(Context, err); break; case AL_FORMAT_71CHN8: case AL_FORMAT_71CHN16: case AL_FORMAT_71CHN32: - LoadData(ALBuf, data, size, freq, format, AL_FORMAT_71CHN32); + err = LoadData(ALBuf, data, size, freq, format, AL_FORMAT_71CHN32); + if(err != AL_NO_ERROR) + alSetError(Context, err); break; case AL_FORMAT_MONO_IMA4: @@ -403,7 +416,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d // Most PC sound software uses 2040+1 samples per channel per block -> block_size=1024*chans bytes if((size%(36*OrigChans)) != 0) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -423,7 +436,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d ALBuf->frequency = freq; } else - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); } break; case AL_FORMAT_MONO_MULAW: @@ -447,7 +460,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d if((size%(1*Channels)) != 0) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -464,7 +477,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d ALBuf->frequency = freq; } else - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); } break; case AL_FORMAT_REAR_MULAW: { @@ -475,7 +488,7 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d if((size%(1*OrigChans)) != 0) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -494,24 +507,24 @@ ALAPI ALvoid ALAPIENTRY alBufferData(ALuint buffer,ALenum format,const ALvoid *d ALBuf->frequency = freq; } else - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); } break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else { // Buffer is in use, or data is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } } else { // Invalid Buffer Name - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); } ProcessContext(Context); @@ -540,7 +553,7 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d if(Context->SampleSource->state == MAPPED) { - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); ProcessContext(Context); return; } @@ -552,12 +565,12 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d if(ALBuf->data == NULL) { // buffer does not have any data - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); } else if(length < 0 || offset < 0 || (length > 0 && data == NULL)) { // data is NULL or offset/length is negative - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } else { @@ -575,13 +588,13 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d ALBuf->eOriginalFormat != AL_FORMAT_REAR16 && ALBuf->eOriginalFormat != AL_FORMAT_REAR32) { - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } if(ALBuf->size/4/NewBytes < (ALuint)offset+length) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -595,14 +608,14 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d if(ALBuf->eOriginalFormat != format) { - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } if((offset%65) != 0 || (length%65) != 0 || ALBuf->size/Channels/Bytes < (ALuint)offset+length) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -621,13 +634,13 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d if(ALBuf->eOriginalFormat != format) { - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } if(ALBuf->size/Channels/Bytes < (ALuint)offset+length) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -644,13 +657,13 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d if(Channels != aluChannelsFromFormat(ALBuf->format)) { - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } if(ALBuf->size/Channels/NewBytes < (ALuint)offset+length) { - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } @@ -662,7 +675,7 @@ ALvoid ALAPIENTRY alBufferSubDataEXT(ALuint buffer,ALenum format,const ALvoid *d else { // Invalid Buffer Name - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); } ProcessContext(Context); @@ -683,13 +696,13 @@ ALAPI void ALAPIENTRY alBufferf(ALuint buffer, ALenum eParam, ALfloat flValue) switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -712,13 +725,13 @@ ALAPI void ALAPIENTRY alBuffer3f(ALuint buffer, ALenum eParam, ALfloat flValue1, switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -739,13 +752,13 @@ ALAPI void ALAPIENTRY alBufferfv(ALuint buffer, ALenum eParam, const ALfloat* fl switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -766,13 +779,13 @@ ALAPI void ALAPIENTRY alBufferi(ALuint buffer, ALenum eParam, ALint lValue) switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -795,13 +808,13 @@ ALAPI void ALAPIENTRY alBuffer3i( ALuint buffer, ALenum eParam, ALint lValue1, A switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -822,13 +835,13 @@ ALAPI void ALAPIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* plVa switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -849,18 +862,18 @@ ALAPI ALvoid ALAPIENTRY alGetBufferf(ALuint buffer, ALenum eParam, ALfloat *pflV switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } } else { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -881,18 +894,18 @@ ALAPI void ALAPIENTRY alGetBuffer3f(ALuint buffer, ALenum eParam, ALfloat* pflVa switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } } else { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -913,18 +926,18 @@ ALAPI void ALAPIENTRY alGetBufferfv(ALuint buffer, ALenum eParam, ALfloat* pflVa switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } } else { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -964,18 +977,18 @@ ALAPI ALvoid ALAPIENTRY alGetBufferi(ALuint buffer, ALenum eParam, ALint *plValu break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } } else { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -996,18 +1009,18 @@ ALAPI void ALAPIENTRY alGetBuffer3i(ALuint buffer, ALenum eParam, ALint* plValue switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } } else { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -1035,18 +1048,18 @@ ALAPI void ALAPIENTRY alGetBufferiv(ALuint buffer, ALenum eParam, ALint* plValue break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } } else { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -1060,7 +1073,7 @@ ALAPI void ALAPIENTRY alGetBufferiv(ALuint buffer, ALenum eParam, ALint* plValue * channel configuration as the original format. This does NOT handle * compressed formats (eg. IMA4). */ -static void LoadData(ALbuffer *ALBuf, const ALubyte *data, ALsizei size, ALuint freq, ALenum OrigFormat, ALenum NewFormat) +static ALenum LoadData(ALbuffer *ALBuf, const ALubyte *data, ALsizei size, ALuint freq, ALenum OrigFormat, ALenum NewFormat) { ALuint NewBytes = aluBytesFromFormat(NewFormat); ALuint NewChannels = aluChannelsFromFormat(NewFormat); @@ -1072,26 +1085,21 @@ static void LoadData(ALbuffer *ALBuf, const ALubyte *data, ALsizei size, ALuint assert(NewChannels == OrigChannels); if ((size%(OrigBytes*OrigChannels)) != 0) - { - alSetError(AL_INVALID_VALUE); - return; - } + return AL_INVALID_VALUE; // Samples are converted here size /= OrigBytes; temp = realloc(ALBuf->data, (BUFFER_PADDING*NewChannels + size) * NewBytes); - if(temp) - { - ALBuf->data = temp; - ConvertData(ALBuf->data, data, OrigBytes, size); + if(!temp) return AL_OUT_OF_MEMORY; + ALBuf->data = temp; + ConvertData(ALBuf->data, data, OrigBytes, size); - ALBuf->format = NewFormat; - ALBuf->eOriginalFormat = OrigFormat; - ALBuf->size = size*NewBytes; - ALBuf->frequency = freq; - } - else - alSetError(AL_OUT_OF_MEMORY); + ALBuf->format = NewFormat; + ALBuf->eOriginalFormat = OrigFormat; + ALBuf->size = size*NewBytes; + ALBuf->frequency = freq; + + return AL_NO_ERROR; } static void ConvertData(ALfloat *dst, const ALvoid *src, ALint origBytes, ALsizei len) diff --git a/OpenAL32/alDatabuffer.c b/OpenAL32/alDatabuffer.c index eaf7acab..c3a39c76 100644 --- a/OpenAL32/alDatabuffer.c +++ b/OpenAL32/alDatabuffer.c @@ -65,7 +65,7 @@ ALvoid ALAPIENTRY alGenDatabuffersEXT(ALsizei n,ALuint *puiBuffers) if(!(*list)) { alDeleteDatabuffersEXT(i, puiBuffers); - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); break; } @@ -79,7 +79,7 @@ ALvoid ALAPIENTRY alGenDatabuffersEXT(ALsizei n,ALuint *puiBuffers) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -119,7 +119,7 @@ ALvoid ALAPIENTRY alDeleteDatabuffersEXT(ALsizei n, const ALuint *puiBuffers) if(ALBuf->state != UNMAPPED) { /* Databuffer still in use, cannot be deleted */ - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); bFailed = AL_TRUE; } } @@ -127,7 +127,7 @@ ALvoid ALAPIENTRY alDeleteDatabuffersEXT(ALsizei n, const ALuint *puiBuffers) else { /* Invalid Databuffer */ - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bFailed = AL_TRUE; } } @@ -167,7 +167,7 @@ ALvoid ALAPIENTRY alDeleteDatabuffersEXT(ALsizei n, const ALuint *puiBuffers) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } @@ -231,16 +231,16 @@ ALvoid ALAPIENTRY alDatabufferDataEXT(ALuint buffer,const ALvoid *data,ALsizei s memcpy(ALBuf->data, data, size); } else - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -262,13 +262,13 @@ ALvoid ALAPIENTRY alDatabufferSubDataEXT(ALuint uiBuffer, ALuint start, ALsizei if(pBuffer->state == UNMAPPED) memcpy(pBuffer->data+start, data, length); else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -290,13 +290,13 @@ ALvoid ALAPIENTRY alGetDatabufferSubDataEXT(ALuint uiBuffer, ALuint start, ALsiz if(pBuffer->state == UNMAPPED) memcpy(data, pBuffer->data+start, length); else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -316,12 +316,12 @@ ALvoid ALAPIENTRY alDatabufferfEXT(ALuint buffer, ALenum eParam, ALfloat flValue switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -340,12 +340,12 @@ ALvoid ALAPIENTRY alDatabufferfvEXT(ALuint buffer, ALenum eParam, const ALfloat* switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -365,12 +365,12 @@ ALvoid ALAPIENTRY alDatabufferiEXT(ALuint buffer, ALenum eParam, ALint lValue) switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -389,12 +389,12 @@ ALvoid ALAPIENTRY alDatabufferivEXT(ALuint buffer, ALenum eParam, const ALint* p switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -414,15 +414,15 @@ ALvoid ALAPIENTRY alGetDatabufferfEXT(ALuint buffer, ALenum eParam, ALfloat *pfl switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -441,15 +441,15 @@ ALvoid ALAPIENTRY alGetDatabufferfvEXT(ALuint buffer, ALenum eParam, ALfloat* pf switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -475,15 +475,15 @@ ALvoid ALAPIENTRY alGetDatabufferiEXT(ALuint buffer, ALenum eParam, ALint *plVal break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -506,15 +506,15 @@ ALvoid ALAPIENTRY alGetDatabufferivEXT(ALuint buffer, ALenum eParam, ALint* plVa break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -536,10 +536,10 @@ ALvoid ALAPIENTRY alSelectDatabufferEXT(ALenum target, ALuint uiBuffer) else if(target == AL_SAMPLE_SINK_EXT) pContext->SampleSink = pBuffer; else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -569,16 +569,16 @@ ALvoid* ALAPIENTRY alMapDatabufferEXT(ALuint uiBuffer, ALuint start, ALsizei len pBuffer->state = MAPPED; } else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); } else - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); @@ -600,10 +600,10 @@ ALvoid ALAPIENTRY alUnmapDatabufferEXT(ALuint uiBuffer) if(pBuffer->state == MAPPED) pBuffer->state = UNMAPPED; else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index 14c92e2a..650857d6 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -64,7 +64,7 @@ ALvoid AL_APIENTRY alGenEffects(ALsizei n, ALuint *effects) { // We must have run out or memory alDeleteEffects(i, effects); - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); break; } @@ -101,7 +101,7 @@ ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects) { if (!alIsEffect(effects[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); break; } } @@ -136,7 +136,7 @@ ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, ALuint *effects) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } @@ -179,7 +179,7 @@ ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) if(isOk) InitEffectParams(ALEffect, iValue); else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } else if(ALEffect->type == AL_EFFECT_EAXREVERB) { @@ -190,11 +190,11 @@ ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) iValue <= AL_EAXREVERB_MAX_DECAY_HFLIMIT) ALEffect->Reverb.DecayHFLimit = iValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -207,11 +207,11 @@ ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) iValue <= AL_REVERB_MAX_DECAY_HFLIMIT) ALEffect->Reverb.DecayHFLimit = iValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -220,15 +220,15 @@ ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) switch(param) { default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -257,7 +257,7 @@ ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -270,7 +270,7 @@ ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -279,15 +279,15 @@ ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, ALint *piValues) switch(param) { default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -312,7 +312,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_DENSITY) ALEffect->Reverb.Density = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_DIFFUSION: @@ -320,7 +320,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_DIFFUSION) ALEffect->Reverb.Diffusion = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_GAIN: @@ -328,7 +328,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_GAIN) ALEffect->Reverb.Gain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_GAINHF: @@ -336,7 +336,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_GAIN) ALEffect->Reverb.GainHF = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_GAINLF: @@ -344,7 +344,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_GAINLF) ALEffect->Reverb.GainLF = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_DECAY_TIME: @@ -352,7 +352,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_DECAY_TIME) ALEffect->Reverb.DecayTime = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_DECAY_HFRATIO: @@ -360,7 +360,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_DECAY_HFRATIO) ALEffect->Reverb.DecayHFRatio = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_DECAY_LFRATIO: @@ -368,7 +368,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_DECAY_LFRATIO) ALEffect->Reverb.DecayLFRatio = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_REFLECTIONS_GAIN: @@ -376,7 +376,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_REFLECTIONS_GAIN) ALEffect->Reverb.ReflectionsGain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_REFLECTIONS_DELAY: @@ -384,7 +384,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_REFLECTIONS_DELAY) ALEffect->Reverb.ReflectionsDelay = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_LATE_REVERB_GAIN: @@ -392,7 +392,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_LATE_REVERB_GAIN) ALEffect->Reverb.LateReverbGain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_LATE_REVERB_DELAY: @@ -400,7 +400,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_LATE_REVERB_DELAY) ALEffect->Reverb.LateReverbDelay = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_AIR_ABSORPTION_GAINHF: @@ -408,7 +408,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF) ALEffect->Reverb.AirAbsorptionGainHF = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_ECHO_TIME: @@ -416,7 +416,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_ECHO_TIME) ALEffect->Reverb.EchoTime = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_ECHO_DEPTH: @@ -424,7 +424,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_ECHO_DEPTH) ALEffect->Reverb.EchoDepth = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_MODULATION_TIME: @@ -432,7 +432,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_MODULATION_TIME) ALEffect->Reverb.ModulationTime = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_MODULATION_DEPTH: @@ -440,7 +440,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_MODULATION_DEPTH) ALEffect->Reverb.ModulationDepth = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_HFREFERENCE: @@ -448,7 +448,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_HFREFERENCE) ALEffect->Reverb.HFReference = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_LFREFERENCE: @@ -456,18 +456,18 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_EAXREVERB_MAX_LFREFERENCE) ALEffect->Reverb.LFReference = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_ROOM_ROLLOFF_FACTOR: if(flValue >= 0.0f && flValue <= 10.0f) ALEffect->Reverb.RoomRolloffFactor = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -480,7 +480,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_DENSITY) ALEffect->Reverb.Density = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_DIFFUSION: @@ -488,7 +488,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_DIFFUSION) ALEffect->Reverb.Diffusion = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_GAIN: @@ -496,7 +496,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_GAIN) ALEffect->Reverb.Gain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_GAINHF: @@ -504,7 +504,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_GAINHF) ALEffect->Reverb.GainHF = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_DECAY_TIME: @@ -512,7 +512,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_DECAY_TIME) ALEffect->Reverb.DecayTime = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_DECAY_HFRATIO: @@ -520,7 +520,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_DECAY_HFRATIO) ALEffect->Reverb.DecayHFRatio = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_REFLECTIONS_GAIN: @@ -528,7 +528,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_REFLECTIONS_GAIN) ALEffect->Reverb.ReflectionsGain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_REFLECTIONS_DELAY: @@ -536,7 +536,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_REFLECTIONS_DELAY) ALEffect->Reverb.ReflectionsDelay = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_LATE_REVERB_GAIN: @@ -544,7 +544,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_LATE_REVERB_GAIN) ALEffect->Reverb.LateReverbGain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_LATE_REVERB_DELAY: @@ -552,7 +552,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_LATE_REVERB_DELAY) ALEffect->Reverb.LateReverbDelay = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_AIR_ABSORPTION_GAINHF: @@ -560,7 +560,7 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_AIR_ABSORPTION_GAINHF) ALEffect->Reverb.AirAbsorptionGainHF = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_REVERB_ROOM_ROLLOFF_FACTOR: @@ -568,11 +568,11 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) flValue <= AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR) ALEffect->Reverb.RoomRolloffFactor = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -584,47 +584,47 @@ ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue) if(flValue >= AL_ECHO_MIN_DELAY && flValue <= AL_ECHO_MAX_DELAY) ALEffect->Echo.Delay = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_ECHO_LRDELAY: if(flValue >= AL_ECHO_MIN_LRDELAY && flValue <= AL_ECHO_MAX_LRDELAY) ALEffect->Echo.LRDelay = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_ECHO_DAMPING: if(flValue >= AL_ECHO_MIN_DAMPING && flValue <= AL_ECHO_MAX_DAMPING) ALEffect->Echo.Damping = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_ECHO_FEEDBACK: if(flValue >= AL_ECHO_MIN_FEEDBACK && flValue <= AL_ECHO_MAX_FEEDBACK) ALEffect->Echo.Feedback = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_ECHO_SPREAD: if(flValue >= AL_ECHO_MIN_SPREAD && flValue <= AL_ECHO_MAX_SPREAD) ALEffect->Echo.Spread = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -675,7 +675,7 @@ ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) ALEffect->Reverb.ReflectionsPan[2] = pflValues[2]; } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_EAXREVERB_LATE_REVERB_PAN: if(!isnan(pflValues[0]) && !isnan(pflValues[1]) && !isnan(pflValues[2])) @@ -685,11 +685,11 @@ ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) ALEffect->Reverb.LateReverbPan[2] = pflValues[2]; } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -713,7 +713,7 @@ ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -730,15 +730,15 @@ ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -767,7 +767,7 @@ ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -780,7 +780,7 @@ ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -789,15 +789,15 @@ ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *piValue) switch(param) { default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -826,7 +826,7 @@ ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -839,7 +839,7 @@ ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -848,15 +848,15 @@ ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *piValues) switch(param) { default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -957,7 +957,7 @@ ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -1014,7 +1014,7 @@ ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -1043,15 +1043,15 @@ ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pflValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -1106,7 +1106,7 @@ ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -1130,7 +1130,7 @@ ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } @@ -1147,15 +1147,15 @@ ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pflValues break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index f6c430a2..8435b426 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -40,15 +40,8 @@ ALAPI ALenum ALAPIENTRY alGetError(ALvoid) return errorCode; } -ALvoid alSetError(ALenum errorCode) +ALvoid alSetError(ALCcontext *Context, ALenum errorCode) { - ALCcontext *Context; - - Context = GetContextSuspended(); - if(Context) - { - if(Context->LastError == AL_NO_ERROR) - Context->LastError = errorCode; - ProcessContext(Context); - } + if(Context->LastError == AL_NO_ERROR) + Context->LastError = errorCode; } diff --git a/OpenAL32/alExtension.c b/OpenAL32/alExtension.c index 3589ff63..7a227471 100644 --- a/OpenAL32/alExtension.c +++ b/OpenAL32/alExtension.c @@ -355,15 +355,16 @@ ALAPI ALboolean ALAPIENTRY alIsExtensionPresent(const ALchar *extName) const char *ptr; size_t len; - if (!extName) + pContext = GetContextSuspended(); + if(!pContext) return AL_FALSE; + + if(!extName) { - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); + ProcessContext(pContext); return AL_FALSE; } - pContext = GetContextSuspended(); - if(!pContext) return AL_FALSE; - len = strlen(extName); ptr = pContext->ExtensionList; while(ptr && *ptr) diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index 318e256d..d001f6a1 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -60,7 +60,7 @@ ALvoid AL_APIENTRY alGenFilters(ALsizei n, ALuint *filters) { // We must have run out or memory alDeleteFilters(i, filters); - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); break; } @@ -97,7 +97,7 @@ ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters) { if (!alIsFilter(filters[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); break; } } @@ -132,7 +132,7 @@ ALvoid AL_APIENTRY alDeleteFilters(ALsizei n, ALuint *filters) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } @@ -172,16 +172,16 @@ ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue) iValue == AL_FILTER_LOWPASS) InitFilterParams(ALFilter, iValue); else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -202,12 +202,12 @@ ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, ALint *piValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -232,29 +232,29 @@ ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat flValue) if(flValue >= 0.0f && flValue <= 1.0f) ALFilter->Gain = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; case AL_LOWPASS_GAINHF: if(flValue >= 0.0f && flValue <= 1.0f) ALFilter->GainHF = flValue; else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -276,7 +276,7 @@ ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, ALfloat *pflValues) } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -299,12 +299,12 @@ ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *piValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -325,12 +325,12 @@ ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -360,18 +360,18 @@ ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *pflValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } @@ -393,7 +393,7 @@ ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pflValues } } else - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); ProcessContext(Context); } diff --git a/OpenAL32/alListener.c b/OpenAL32/alListener.c index 6a9ee65d..8928ba7a 100644 --- a/OpenAL32/alListener.c +++ b/OpenAL32/alListener.c @@ -43,7 +43,7 @@ ALAPI ALvoid ALAPIENTRY alListenerf(ALenum eParam, ALfloat flValue) updateAll = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_METERS_PER_UNIT: @@ -53,11 +53,11 @@ ALAPI ALvoid ALAPIENTRY alListenerf(ALenum eParam, ALfloat flValue) updateAll = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } @@ -102,7 +102,7 @@ ALAPI ALvoid ALAPIENTRY alListener3f(ALenum eParam, ALfloat flValue1, ALfloat fl break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } @@ -155,12 +155,12 @@ ALAPI ALvoid ALAPIENTRY alListenerfv(ALenum eParam, const ALfloat *pflValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); if(updateWorld) { @@ -189,7 +189,7 @@ ALAPI ALvoid ALAPIENTRY alListeneri(ALenum eParam, ALint lValue) switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } @@ -212,7 +212,7 @@ ALAPI void ALAPIENTRY alListener3i(ALenum eParam, ALint lValue1, ALint lValue2, break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } @@ -251,12 +251,12 @@ ALAPI void ALAPIENTRY alListeneriv( ALenum eParam, const ALint* plValues ) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -282,12 +282,12 @@ ALAPI ALvoid ALAPIENTRY alGetListenerf(ALenum eParam, ALfloat *pflValue) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -317,12 +317,12 @@ ALAPI ALvoid ALAPIENTRY alGetListener3f(ALenum eParam, ALfloat *pflValue1, ALflo break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -370,12 +370,12 @@ ALAPI ALvoid ALAPIENTRY alGetListenerfv(ALenum eParam, ALfloat *pflValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -393,12 +393,12 @@ ALAPI ALvoid ALAPIENTRY alGetListeneri(ALenum eParam, ALint *plValue) switch(eParam) { default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -428,12 +428,12 @@ ALAPI void ALAPIENTRY alGetListener3i(ALenum eParam, ALint *plValue1, ALint *plV break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -473,12 +473,12 @@ ALAPI void ALAPIENTRY alGetListeneriv(ALenum eParam, ALint* plValues) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 3f6c80c4..8feea7eb 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -67,7 +67,7 @@ ALAPI ALvoid ALAPIENTRY alGenSources(ALsizei n,ALuint *sources) if(!(*list)) { alDeleteSources(i, sources); - alSetError(AL_OUT_OF_MEMORY); + alSetError(Context, AL_OUT_OF_MEMORY); break; } @@ -84,13 +84,13 @@ ALAPI ALvoid ALAPIENTRY alGenSources(ALsizei n,ALuint *sources) else { // Not enough resources to create the Sources - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } } else { // Bad pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } } @@ -120,7 +120,7 @@ ALAPI ALvoid ALAPIENTRY alDeleteSources(ALsizei n, const ALuint *sources) { if (!alIsSource(sources[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bSourcesValid = AL_FALSE; break; } @@ -176,7 +176,7 @@ ALAPI ALvoid ALAPIENTRY alDeleteSources(ALsizei n, const ALuint *sources) } } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); ProcessContext(Context); } @@ -233,7 +233,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_CONE_INNER_ANGLE: @@ -243,7 +243,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_CONE_OUTER_ANGLE: @@ -253,7 +253,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_GAIN: @@ -263,7 +263,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_MAX_DISTANCE: @@ -273,7 +273,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_ROLLOFF_FACTOR: @@ -283,7 +283,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_REFERENCE_DISTANCE: @@ -293,7 +293,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_MIN_GAIN: @@ -303,7 +303,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_MAX_GAIN: @@ -313,7 +313,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_CONE_OUTER_GAIN: @@ -323,7 +323,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_CONE_OUTER_GAINHF: @@ -333,7 +333,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_AIR_ABSORPTION_FACTOR: @@ -343,7 +343,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_ROOM_ROLLOFF_FACTOR: @@ -353,7 +353,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_DOPPLER_FACTOR: @@ -363,7 +363,7 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_SEC_OFFSET: @@ -382,22 +382,22 @@ ALAPI ALvoid ALAPIENTRY alSourcef(ALuint source, ALenum eParam, ALfloat flValue) if ((pSource->state == AL_PLAYING) || (pSource->state == AL_PAUSED)) { if(ApplyOffset(pSource) == AL_FALSE) - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else { // Invalid Source Name - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } ProcessContext(pContext); @@ -439,12 +439,12 @@ ALAPI ALvoid ALAPIENTRY alSource3f(ALuint source, ALenum eParam, ALfloat flValue break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -489,15 +489,15 @@ ALAPI ALvoid ALAPIENTRY alSourcefv(ALuint source, ALenum eParam, const ALfloat * break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -533,14 +533,14 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_LOOPING: if(lValue == AL_FALSE || lValue == AL_TRUE) pSource->bLooping = (ALboolean)lValue; else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_BUFFER: @@ -595,15 +595,15 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); break; case AL_SOURCE_STATE: // Query only - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); break; case AL_SEC_OFFSET: @@ -622,11 +622,11 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) if(pSource->state == AL_PLAYING || pSource->state == AL_PAUSED) { if(ApplyOffset(pSource) == AL_FALSE) - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_DIRECT_FILTER: @@ -643,7 +643,7 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_DIRECT_FILTER_GAINHF_AUTO: @@ -653,7 +653,7 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_AUXILIARY_SEND_FILTER_GAIN_AUTO: @@ -663,7 +663,7 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO: @@ -673,7 +673,7 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; case AL_DISTANCE_MODEL: @@ -690,16 +690,16 @@ ALAPI ALvoid ALAPIENTRY alSourcei(ALuint source,ALenum eParam,ALint lValue) pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -752,16 +752,16 @@ ALAPI void ALAPIENTRY alSource3i(ALuint source, ALenum eParam, ALint lValue1, AL pSource->NeedsUpdate = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); ProcessContext(pContext); } @@ -808,15 +808,15 @@ ALAPI void ALAPIENTRY alSourceiv(ALuint source, ALenum eParam, const ALint* plVa break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -880,7 +880,7 @@ ALAPI ALvoid ALAPIENTRY alGetSourcef(ALuint source, ALenum eParam, ALfloat *pflV if(GetSourceOffset(pSource, eParam, flOffset, updateLen)) *pflValue = flOffset[0]; else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); break; case AL_CONE_INNER_ANGLE: @@ -908,15 +908,15 @@ ALAPI ALvoid ALAPIENTRY alGetSourcef(ALuint source, ALenum eParam, ALfloat *pflV break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -957,15 +957,15 @@ ALAPI ALvoid ALAPIENTRY alGetSource3f(ALuint source, ALenum eParam, ALfloat* pfl break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -1019,7 +1019,7 @@ ALAPI ALvoid ALAPIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *pfl pflValues[1] = flOffset[1]; } else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); break; case AL_POSITION: @@ -1041,15 +1041,15 @@ ALAPI ALvoid ALAPIENTRY alGetSourcefv(ALuint source, ALenum eParam, ALfloat *pfl break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -1136,7 +1136,7 @@ ALAPI ALvoid ALAPIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plValu if(GetSourceOffset(pSource, eParam, flOffset, updateLen)) *plValue = (ALint)flOffset[0]; else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); break; case AL_DIRECT_FILTER: @@ -1164,15 +1164,15 @@ ALAPI ALvoid ALAPIENTRY alGetSourcei(ALuint source, ALenum eParam, ALint *plValu break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -1213,15 +1213,15 @@ ALAPI void ALAPIENTRY alGetSource3i(ALuint source, ALenum eParam, ALint* plValue break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -1279,7 +1279,7 @@ ALAPI void ALAPIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plValue plValues[1] = (ALint)flOffset[1]; } else - alSetError(AL_INVALID_OPERATION); + alSetError(pContext, AL_INVALID_OPERATION); break; case AL_POSITION: @@ -1301,15 +1301,15 @@ ALAPI void ALAPIENTRY alGetSourceiv(ALuint source, ALenum eParam, ALint* plValue break; default: - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } } else - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); ProcessContext(pContext); } @@ -1339,7 +1339,7 @@ ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint *pSourceList) { if(!alIsSource(pSourceList[i])) { - alSetError(AL_INVALID_NAME); + alSetError(pContext, AL_INVALID_NAME); bSourcesValid = AL_FALSE; break; } @@ -1412,7 +1412,7 @@ ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint *pSourceList) else { // sources is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); } ProcessContext(pContext); @@ -1440,7 +1440,7 @@ ALAPI ALvoid ALAPIENTRY alSourcePausev(ALsizei n, const ALuint *sources) { if(!alIsSource(sources[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bSourcesValid = AL_FALSE; break; } @@ -1459,7 +1459,7 @@ ALAPI ALvoid ALAPIENTRY alSourcePausev(ALsizei n, const ALuint *sources) else { // sources is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -1487,7 +1487,7 @@ ALAPI ALvoid ALAPIENTRY alSourceStopv(ALsizei n, const ALuint *sources) { if(!alIsSource(sources[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bSourcesValid = AL_FALSE; break; } @@ -1510,7 +1510,7 @@ ALAPI ALvoid ALAPIENTRY alSourceStopv(ALsizei n, const ALuint *sources) else { // sources is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -1538,7 +1538,7 @@ ALAPI ALvoid ALAPIENTRY alSourceRewindv(ALsizei n, const ALuint *sources) { if(!alIsSource(sources[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bSourcesValid = AL_FALSE; break; } @@ -1565,7 +1565,7 @@ ALAPI ALvoid ALAPIENTRY alSourceRewindv(ALsizei n, const ALuint *sources) else { // sources is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -1623,7 +1623,7 @@ ALAPI ALvoid ALAPIENTRY alSourceQueueBuffers( ALuint source, ALsizei n, const AL if(!alIsBuffer(buffers[i])) { - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); bBuffersValid = AL_FALSE; break; } @@ -1639,7 +1639,7 @@ ALAPI ALvoid ALAPIENTRY alSourceQueueBuffers( ALuint source, ALsizei n, const AL else if(iFrequency != buffer->frequency || iFormat != buffer->format) { - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); bBuffersValid = AL_FALSE; break; } @@ -1705,13 +1705,13 @@ ALAPI ALvoid ALAPIENTRY alSourceQueueBuffers( ALuint source, ALsizei n, const AL else { // Invalid Source Type (can't queue on a Static Source) - alSetError(AL_INVALID_OPERATION); + alSetError(Context, AL_INVALID_OPERATION); } } else { // Invalid Source Name - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); } ProcessContext(Context); @@ -1776,13 +1776,13 @@ ALAPI ALvoid ALAPIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint else { // Some buffers can't be unqueue because they have not been processed - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } } else { // Invalid Source Name - alSetError(AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME); } ProcessContext(Context); diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c index 32d86f35..4ca25dfe 100644 --- a/OpenAL32/alState.c +++ b/OpenAL32/alState.c @@ -57,7 +57,7 @@ ALAPI ALvoid ALAPIENTRY alEnable(ALenum capability) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -90,7 +90,7 @@ ALAPI ALvoid ALAPIENTRY alDisable(ALenum capability) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -122,7 +122,7 @@ ALAPI ALboolean ALAPIENTRY alIsEnabled(ALenum capability) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -162,7 +162,7 @@ ALAPI ALboolean ALAPIENTRY alGetBoolean(ALenum pname) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -198,7 +198,7 @@ ALAPI ALdouble ALAPIENTRY alGetDouble(ALenum pname) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -234,7 +234,7 @@ ALAPI ALfloat ALAPIENTRY alGetFloat(ALenum pname) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -284,7 +284,7 @@ ALAPI ALint ALAPIENTRY alGetInteger(ALenum pname) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } @@ -321,14 +321,14 @@ ALAPI ALvoid ALAPIENTRY alGetBooleanv(ALenum pname,ALboolean *data) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else { // data is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -362,14 +362,14 @@ ALAPI ALvoid ALAPIENTRY alGetDoublev(ALenum pname,ALdouble *data) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else { // data is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -403,14 +403,14 @@ ALAPI ALvoid ALAPIENTRY alGetFloatv(ALenum pname,ALfloat *data) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else { // data is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -458,14 +458,14 @@ ALAPI ALvoid ALAPIENTRY alGetIntegerv(ALenum pname,ALint *data) break; default: - alSetError(AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM); break; } } else { // data is a NULL pointer - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); } ProcessContext(Context); @@ -523,7 +523,7 @@ ALAPI const ALchar* ALAPIENTRY alGetString(ALenum pname) default: value=NULL; - alSetError(AL_INVALID_ENUM); + alSetError(pContext, AL_INVALID_ENUM); break; } @@ -546,7 +546,7 @@ ALAPI ALvoid ALAPIENTRY alDopplerFactor(ALfloat value) updateSources = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); // Force updating the sources for these parameters, since even head- // relative sources are affected @@ -577,7 +577,7 @@ ALAPI ALvoid ALAPIENTRY alDopplerVelocity(ALfloat value) updateSources = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); if(updateSources) { @@ -606,7 +606,7 @@ ALAPI ALvoid ALAPIENTRY alSpeedOfSound(ALfloat flSpeedOfSound) updateSources = AL_TRUE; } else - alSetError(AL_INVALID_VALUE); + alSetError(pContext, AL_INVALID_VALUE); if(updateSources) { @@ -643,7 +643,7 @@ ALAPI ALvoid ALAPIENTRY alDistanceModel(ALenum value) break; default: - alSetError(AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE); break; } |