diff options
author | Chris Robinson <[email protected]> | 2018-01-24 12:10:48 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-24 12:10:48 -0800 |
commit | 786a05876e492074aba245209d11fb73d05ad60a (patch) | |
tree | 1caade0900214c3a4106475e97c3b07c135ac5df /OpenAL32 | |
parent | caa3b4f7f833278498a78f261e8badb85fd2896b (diff) |
Call the event callback when an error is generated
Most errors don't yet provide correct object IDs or text messages for the AL
error.
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alError.h | 8 | ||||
-rw-r--r-- | OpenAL32/alBuffer.c | 15 | ||||
-rw-r--r-- | OpenAL32/alEffect.c | 18 | ||||
-rw-r--r-- | OpenAL32/alError.c | 31 | ||||
-rw-r--r-- | OpenAL32/alFilter.c | 18 | ||||
-rw-r--r-- | OpenAL32/alSource.c | 128 |
6 files changed, 114 insertions, 104 deletions
diff --git a/OpenAL32/Include/alError.h b/OpenAL32/Include/alError.h index ab91d27b..f94802b3 100644 --- a/OpenAL32/Include/alError.h +++ b/OpenAL32/Include/alError.h @@ -9,20 +9,20 @@ extern "C" { extern ALboolean TrapALError; -ALvoid alSetError(ALCcontext *Context, ALenum errorCode); +ALvoid alSetError(ALCcontext *context, ALenum errorCode, ALuint objid, const char *msg); #define SET_ERROR_AND_RETURN(ctx, err) do { \ - alSetError((ctx), (err)); \ + alSetError((ctx), (err), 0, "Unimplemented message"); \ return; \ } while(0) #define SET_ERROR_AND_RETURN_VALUE(ctx, err, val) do { \ - alSetError((ctx), (err)); \ + alSetError((ctx), (err), 0, "Unimplemented message"); \ return (val); \ } while(0) #define SET_ERROR_AND_GOTO(ctx, err, lbl) do { \ - alSetError((ctx), (err)); \ + alSetError((ctx), (err), 0, "Unimplemented message"); \ goto lbl; \ } while(0) diff --git a/OpenAL32/alBuffer.c b/OpenAL32/alBuffer.c index 1290ca23..e707dc36 100644 --- a/OpenAL32/alBuffer.c +++ b/OpenAL32/alBuffer.c @@ -277,7 +277,7 @@ AL_API void AL_APIENTRY alUnmapBufferSOFT(ALuint buffer) WriteLock(&albuf->lock); if(albuf->MappedAccess == 0) - alSetError(context, AL_INVALID_OPERATION); + alSetError(context, AL_INVALID_OPERATION, albuf->id, "Unmapping an unmapped buffer"); else { albuf->MappedAccess = 0; @@ -307,10 +307,11 @@ AL_API void AL_APIENTRY alFlushMappedBufferSOFT(ALuint buffer, ALsizei offset, A WriteLock(&albuf->lock); if(albuf->MappedAccess == 0 || !(albuf->MappedAccess&AL_MAP_WRITE_BIT_SOFT)) - alSetError(context, AL_INVALID_OPERATION); + alSetError(context, AL_INVALID_OPERATION, albuf->id, + "Flushing a buffer not mapped for writing"); else if(offset < albuf->MappedOffset || offset >= albuf->MappedOffset+albuf->MappedSize || length <= 0 || length > albuf->MappedOffset+albuf->MappedSize-offset) - alSetError(context, AL_INVALID_VALUE); + alSetError(context, AL_INVALID_VALUE, albuf->id, "Flushing an invalid range"); else { /* FIXME: Need to use some method of double-buffering for the mixer and @@ -408,7 +409,7 @@ AL_API void AL_APIENTRY alBufferSamplesSOFT(ALuint UNUSED(buffer), context = GetContextRef(); if(!context) return; - alSetError(context, AL_INVALID_OPERATION); + alSetError(context, AL_INVALID_OPERATION, 0, "alBufferSamplesSOFT not supported"); ALCcontext_DecRef(context); } @@ -422,7 +423,7 @@ AL_API void AL_APIENTRY alBufferSubSamplesSOFT(ALuint UNUSED(buffer), context = GetContextRef(); if(!context) return; - alSetError(context, AL_INVALID_OPERATION); + alSetError(context, AL_INVALID_OPERATION, 0, "alBufferSubSamplesSOFT not supported"); ALCcontext_DecRef(context); } @@ -436,7 +437,7 @@ AL_API void AL_APIENTRY alGetBufferSamplesSOFT(ALuint UNUSED(buffer), context = GetContextRef(); if(!context) return; - alSetError(context, AL_INVALID_OPERATION); + alSetError(context, AL_INVALID_OPERATION, 0, "alGetBufferSamplesSOFT not supported"); ALCcontext_DecRef(context); } @@ -448,7 +449,7 @@ AL_API ALboolean AL_APIENTRY alIsBufferFormatSupportedSOFT(ALenum UNUSED(format) context = GetContextRef(); if(!context) return AL_FALSE; - alSetError(context, AL_INVALID_OPERATION); + alSetError(context, AL_INVALID_OPERATION, 0, "alIsBufferFormatSupportedSOFT not supported"); ALCcontext_DecRef(context); return AL_FALSE; diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index bb56e6a3..755d792e 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -167,7 +167,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint value) Device = Context->Device; LockEffectsWrite(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { if(param == AL_EFFECT_TYPE) @@ -184,7 +184,7 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint value) if(isOk) InitEffectParams(ALEffect, value); else - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, effect, "Effect type not supported"); } else { @@ -216,7 +216,7 @@ AL_API ALvoid AL_APIENTRY alEffectiv(ALuint effect, ALenum param, const ALint *v Device = Context->Device; LockEffectsWrite(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { /* Call the appropriate handler */ @@ -239,7 +239,7 @@ AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat value) Device = Context->Device; LockEffectsWrite(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { /* Call the appropriate handler */ @@ -262,7 +262,7 @@ AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, const ALfloat Device = Context->Device; LockEffectsWrite(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { /* Call the appropriate handler */ @@ -285,7 +285,7 @@ AL_API ALvoid AL_APIENTRY alGetEffecti(ALuint effect, ALenum param, ALint *value Device = Context->Device; LockEffectsRead(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { if(param == AL_EFFECT_TYPE) @@ -320,7 +320,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectiv(ALuint effect, ALenum param, ALint *valu Device = Context->Device; LockEffectsRead(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { /* Call the appropriate handler */ @@ -343,7 +343,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *val Device = Context->Device; LockEffectsRead(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { /* Call the appropriate handler */ @@ -366,7 +366,7 @@ AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *va Device = Context->Device; LockEffectsRead(Device); if((ALEffect=LookupEffect(Device, effect)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, effect, "Invalid effect ID"); else { /* Call the appropriate handler */ diff --git a/OpenAL32/alError.c b/OpenAL32/alError.c index 6c953977..8d138aa2 100644 --- a/OpenAL32/alError.c +++ b/OpenAL32/alError.c @@ -33,11 +33,12 @@ ALboolean TrapALError = AL_FALSE; -ALvoid alSetError(ALCcontext *Context, ALenum errorCode) +ALvoid alSetError(ALCcontext *context, ALenum errorCode, ALuint objid, const char *msg) { ALenum curerr = AL_NO_ERROR; - WARN("Error generated on context %p, code 0x%04x\n", Context, errorCode); + WARN("Error generated on context %p, code 0x%04x, object %u, \"%s\"\n", + context, errorCode, objid, msg); if(TrapALError) { #ifdef _WIN32 @@ -49,19 +50,27 @@ ALvoid alSetError(ALCcontext *Context, ALenum errorCode) #endif } - (void)(ATOMIC_COMPARE_EXCHANGE_STRONG_SEQ(&Context->LastError, &curerr, errorCode)); + ATOMIC_COMPARE_EXCHANGE_STRONG_SEQ(&context->LastError, &curerr, errorCode); + if((context->EnabledEvts&EventType_Error)) + { + almtx_lock(&context->EventLock); + if((context->EnabledEvts&EventType_Error) && context->EventCb) + (*context->EventCb)(AL_EVENT_TYPE_ERROR_SOFT, objid, errorCode, strlen(msg), msg, + context->EventParam); + almtx_unlock(&context->EventLock); + } } AL_API ALenum AL_APIENTRY alGetError(void) { - ALCcontext *Context; + ALCcontext *context; ALenum errorCode; - Context = GetContextRef(); - if(!Context) + context = GetContextRef(); + if(!context) { - WARN("Querying error state on null context (implicitly 0x%04x)\n", - AL_INVALID_OPERATION); + const ALenum deferror = AL_INVALID_OPERATION; + WARN("Querying error state on null context (implicitly 0x%04x)\n", deferror); if(TrapALError) { #ifdef _WIN32 @@ -71,12 +80,12 @@ AL_API ALenum AL_APIENTRY alGetError(void) raise(SIGTRAP); #endif } - return AL_INVALID_OPERATION; + return deferror; } - errorCode = ATOMIC_EXCHANGE_SEQ(&Context->LastError, AL_NO_ERROR); + errorCode = ATOMIC_EXCHANGE_SEQ(&context->LastError, AL_NO_ERROR); - ALCcontext_DecRef(Context); + ALCcontext_DecRef(context); return errorCode; } diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index 4771414a..16796760 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -152,7 +152,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint value) Device = Context->Device; LockFiltersWrite(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { if(param == AL_FILTER_TYPE) @@ -161,7 +161,7 @@ AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint value) value == AL_FILTER_HIGHPASS || value == AL_FILTER_BANDPASS) InitFilterParams(ALFilter, value); else - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, filter, "Filter type not supported"); } else { @@ -193,7 +193,7 @@ AL_API ALvoid AL_APIENTRY alFilteriv(ALuint filter, ALenum param, const ALint *v Device = Context->Device; LockFiltersWrite(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { /* Call the appropriate handler */ @@ -216,7 +216,7 @@ AL_API ALvoid AL_APIENTRY alFilterf(ALuint filter, ALenum param, ALfloat value) Device = Context->Device; LockFiltersWrite(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { /* Call the appropriate handler */ @@ -239,7 +239,7 @@ AL_API ALvoid AL_APIENTRY alFilterfv(ALuint filter, ALenum param, const ALfloat Device = Context->Device; LockFiltersWrite(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { /* Call the appropriate handler */ @@ -262,7 +262,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteri(ALuint filter, ALenum param, ALint *value Device = Context->Device; LockFiltersRead(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { if(param == AL_FILTER_TYPE) @@ -297,7 +297,7 @@ AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *valu Device = Context->Device; LockFiltersRead(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { /* Call the appropriate handler */ @@ -320,7 +320,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterf(ALuint filter, ALenum param, ALfloat *val Device = Context->Device; LockFiltersRead(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { /* Call the appropriate handler */ @@ -343,7 +343,7 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *va Device = Context->Device; LockFiltersRead(Device); if((ALFilter=LookupFilter(Device, filter)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, filter, "Invalid filter ID"); else { /* Call the appropriate handler */ diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 8b3cb305..2b561597 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -1844,9 +1844,9 @@ AL_API ALvoid AL_APIENTRY alSourcef(ALuint source, ALenum param, ALfloat value) WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(FloatValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid float property"); else SetSourcefv(Source, Context, param, &value); UnlockSourcesRead(Context); @@ -1866,9 +1866,9 @@ AL_API ALvoid AL_APIENTRY alSource3f(ALuint source, ALenum param, ALfloat value1 WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(FloatValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-float property"); else { ALfloat fvals[3] = { value1, value2, value3 }; @@ -1891,11 +1891,11 @@ AL_API ALvoid AL_APIENTRY alSourcefv(ALuint source, ALenum param, const ALfloat WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(FloatValsByProp(param) > 0)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid float-vector property"); else SetSourcefv(Source, Context, param, values); UnlockSourcesRead(Context); @@ -1916,9 +1916,9 @@ AL_API ALvoid AL_APIENTRY alSourcedSOFT(ALuint source, ALenum param, ALdouble va WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(DoubleValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid double property"); else { ALfloat fval = (ALfloat)value; @@ -1941,9 +1941,9 @@ AL_API ALvoid AL_APIENTRY alSource3dSOFT(ALuint source, ALenum param, ALdouble v WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(DoubleValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-double property"); else { ALfloat fvals[3] = { (ALfloat)value1, (ALfloat)value2, (ALfloat)value3 }; @@ -1967,11 +1967,11 @@ AL_API ALvoid AL_APIENTRY alSourcedvSOFT(ALuint source, ALenum param, const ALdo WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!((count=DoubleValsByProp(param)) > 0 && count <= 6)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid double-vector property"); else { ALfloat fvals[6]; @@ -1999,9 +1999,9 @@ AL_API ALvoid AL_APIENTRY alSourcei(ALuint source, ALenum param, ALint value) WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(IntValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer property"); else SetSourceiv(Source, Context, param, &value); UnlockSourcesRead(Context); @@ -2021,9 +2021,9 @@ AL_API void AL_APIENTRY alSource3i(ALuint source, ALenum param, ALint value1, AL WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(IntValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer property"); else { ALint ivals[3] = { value1, value2, value3 }; @@ -2046,11 +2046,11 @@ AL_API void AL_APIENTRY alSourceiv(ALuint source, ALenum param, const ALint *val WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(IntValsByProp(param) > 0)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer-vector property"); else SetSourceiv(Source, Context, param, values); UnlockSourcesRead(Context); @@ -2071,9 +2071,9 @@ AL_API ALvoid AL_APIENTRY alSourcei64SOFT(ALuint source, ALenum param, ALint64SO WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(Int64ValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64 property"); else SetSourcei64v(Source, Context, param, &value); UnlockSourcesRead(Context); @@ -2093,9 +2093,9 @@ AL_API void AL_APIENTRY alSource3i64SOFT(ALuint source, ALenum param, ALint64SOF WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(Int64ValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer64 property"); else { ALint64SOFT i64vals[3] = { value1, value2, value3 }; @@ -2118,11 +2118,11 @@ AL_API void AL_APIENTRY alSourcei64vSOFT(ALuint source, ALenum param, const ALin WriteLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(Int64ValsByProp(param) > 0)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64-vector property"); else SetSourcei64v(Source, Context, param, values); UnlockSourcesRead(Context); @@ -2143,11 +2143,11 @@ AL_API ALvoid AL_APIENTRY alGetSourcef(ALuint source, ALenum param, ALfloat *val ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!value) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(FloatValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid float property"); else { ALdouble dval; @@ -2172,11 +2172,11 @@ AL_API ALvoid AL_APIENTRY alGetSource3f(ALuint source, ALenum param, ALfloat *va ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(value1 && value2 && value3)) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(FloatValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-float property"); else { ALdouble dvals[3]; @@ -2206,11 +2206,11 @@ AL_API ALvoid AL_APIENTRY alGetSourcefv(ALuint source, ALenum param, ALfloat *va ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!((count=FloatValsByProp(param)) > 0 && count <= 6)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid float-vector property"); else { ALdouble dvals[6]; @@ -2239,11 +2239,11 @@ AL_API void AL_APIENTRY alGetSourcedSOFT(ALuint source, ALenum param, ALdouble * ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!value) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(DoubleValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid double property"); else GetSourcedv(Source, Context, param, value); UnlockSourcesRead(Context); @@ -2263,11 +2263,11 @@ AL_API void AL_APIENTRY alGetSource3dSOFT(ALuint source, ALenum param, ALdouble ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(value1 && value2 && value3)) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(DoubleValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-double property"); else { ALdouble dvals[3]; @@ -2295,11 +2295,11 @@ AL_API void AL_APIENTRY alGetSourcedvSOFT(ALuint source, ALenum param, ALdouble ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(DoubleValsByProp(param) > 0)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid double-vector property"); else GetSourcedv(Source, Context, param, values); UnlockSourcesRead(Context); @@ -2320,11 +2320,11 @@ AL_API ALvoid AL_APIENTRY alGetSourcei(ALuint source, ALenum param, ALint *value ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!value) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(IntValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer property"); else GetSourceiv(Source, Context, param, value); UnlockSourcesRead(Context); @@ -2345,11 +2345,11 @@ AL_API void AL_APIENTRY alGetSource3i(ALuint source, ALenum param, ALint *value1 ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(value1 && value2 && value3)) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(IntValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer property"); else { ALint ivals[3]; @@ -2378,11 +2378,11 @@ AL_API void AL_APIENTRY alGetSourceiv(ALuint source, ALenum param, ALint *values ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(IntValsByProp(param) > 0)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer-vector property"); else GetSourceiv(Source, Context, param, values); UnlockSourcesRead(Context); @@ -2403,11 +2403,11 @@ AL_API void AL_APIENTRY alGetSourcei64SOFT(ALuint source, ALenum param, ALint64S ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!value) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(Int64ValsByProp(param) == 1)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64 property"); else GetSourcei64v(Source, Context, param, value); UnlockSourcesRead(Context); @@ -2427,11 +2427,11 @@ AL_API void AL_APIENTRY alGetSource3i64SOFT(ALuint source, ALenum param, ALint64 ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!(value1 && value2 && value3)) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(Int64ValsByProp(param) == 3)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid 3-integer64 property"); else { ALint64 i64vals[3]; @@ -2459,11 +2459,11 @@ AL_API void AL_APIENTRY alGetSourcei64vSOFT(ALuint source, ALenum param, ALint64 ReadLock(&Context->PropLock); LockSourcesRead(Context); if((Source=LookupSource(Context, source)) == NULL) - alSetError(Context, AL_INVALID_NAME); + alSetError(Context, AL_INVALID_NAME, source, "Invalid source ID"); else if(!values) - alSetError(Context, AL_INVALID_VALUE); + alSetError(Context, AL_INVALID_VALUE, source, "NULL pointer"); else if(!(Int64ValsByProp(param) > 0)) - alSetError(Context, AL_INVALID_ENUM); + alSetError(Context, AL_INVALID_ENUM, source, "Invalid integer64-vector property"); else GetSourcei64v(Source, Context, param, values); UnlockSourcesRead(Context); |