Add special handling for alGerError in the router
This commit is contained in:
+11
-4
@@ -9,8 +9,6 @@
|
||||
|
||||
ATOMIC(DriverIface*) CurrentCtxDriver = ATOMIC_INIT_STATIC(NULL);
|
||||
|
||||
#define DECL_THUNK0(R, n) AL_API R AL_APIENTRY n(void) \
|
||||
{ return ATOMIC_LOAD_SEQ(&CurrentCtxDriver)->n(); }
|
||||
#define DECL_THUNK1(R, n, T1) AL_API R AL_APIENTRY n(T1 a) \
|
||||
{ return ATOMIC_LOAD_SEQ(&CurrentCtxDriver)->n(a); }
|
||||
#define DECL_THUNK2(R, n, T1, T2) AL_API R AL_APIENTRY n(T1 a, T2 b) \
|
||||
@@ -23,6 +21,17 @@ ATOMIC(DriverIface*) CurrentCtxDriver = ATOMIC_INIT_STATIC(NULL);
|
||||
{ return ATOMIC_LOAD_SEQ(&CurrentCtxDriver)->n(a, b, c, d, e); }
|
||||
|
||||
|
||||
/* Ugly hack for some apps calling alGetError without a current context, and
|
||||
* expecting it to be AL_NO_ERROR.
|
||||
*/
|
||||
AL_API ALenum AL_APIENTRY alGetError(void)
|
||||
{
|
||||
DriverIface *iface = ATOMIC_LOAD_SEQ(&CurrentCtxDriver);
|
||||
if(iface) return iface->alGetError();
|
||||
return AL_NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
DECL_THUNK1(void, alDopplerFactor, ALfloat)
|
||||
DECL_THUNK1(void, alDopplerVelocity, ALfloat)
|
||||
DECL_THUNK1(void, alSpeedOfSound, ALfloat)
|
||||
@@ -42,8 +51,6 @@ DECL_THUNK1(ALint, alGetInteger, ALenum)
|
||||
DECL_THUNK1(ALfloat, alGetFloat, ALenum)
|
||||
DECL_THUNK1(ALdouble, alGetDouble, ALenum)
|
||||
|
||||
DECL_THUNK0(ALenum, alGetError)
|
||||
|
||||
DECL_THUNK1(ALboolean, alIsExtensionPresent, const ALchar*)
|
||||
DECL_THUNK1(void*, alGetProcAddress, const ALchar*)
|
||||
DECL_THUNK1(ALenum, alGetEnumValue, const ALchar*)
|
||||
|
||||
Reference in New Issue
Block a user