aboutsummaryrefslogtreecommitdiffstats
path: root/al/state.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-07-25 15:24:07 -0700
committerChris Robinson <[email protected]>2023-07-26 12:58:38 -0700
commitd8f34d616190bf26dd48c8778aa3311c73eca98b (patch)
tree425c5d5e8a86e72924eae9bc19c52063a5e6f69c /al/state.cpp
parent34d07fde84ad64342ae6624334957143319615ab (diff)
Declare functions closer to where they're needed
This provides better code locality when calling implicit context functions that call their direct context variants.
Diffstat (limited to 'al/state.cpp')
-rw-r--r--al/state.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/al/state.cpp b/al/state.cpp
index e831ccc1..5b0772c7 100644
--- a/al/state.cpp
+++ b/al/state.cpp
@@ -302,6 +302,7 @@ AL_API const ALchar* AL_APIENTRY alsoft_get_version(void) noexcept
}
+AL_API DECL_FUNC1(void, alEnable, ALenum)
FORCE_ALIGN void AL_APIENTRY alEnableDirect(ALCcontext *context, ALenum capability) noexcept
{
switch(capability)
@@ -327,6 +328,7 @@ FORCE_ALIGN void AL_APIENTRY alEnableDirect(ALCcontext *context, ALenum capabili
}
}
+AL_API DECL_FUNC1(void, alDisable, ALenum)
FORCE_ALIGN void AL_APIENTRY alDisableDirect(ALCcontext *context, ALenum capability) noexcept
{
switch(capability)
@@ -352,6 +354,7 @@ FORCE_ALIGN void AL_APIENTRY alDisableDirect(ALCcontext *context, ALenum capabil
}
}
+AL_API DECL_FUNC1(ALboolean, alIsEnabled, ALenum)
FORCE_ALIGN ALboolean AL_APIENTRY alIsEnabledDirect(ALCcontext *context, ALenum capability) noexcept
{
std::lock_guard<std::mutex> _{context->mPropLock};
@@ -404,6 +407,7 @@ DECL_GETFUNC(ALvoid*, alGetPointer,SOFT)
#undef DECL_GETFUNC
+AL_API DECL_FUNC2(void, alGetBooleanv, ALenum, ALboolean*)
FORCE_ALIGN void AL_APIENTRY alGetBooleanvDirect(ALCcontext *context, ALenum pname, ALboolean *values) noexcept
{
if(!values) UNLIKELY
@@ -411,6 +415,7 @@ FORCE_ALIGN void AL_APIENTRY alGetBooleanvDirect(ALCcontext *context, ALenum pna
GetValue(context, pname, values);
}
+AL_API DECL_FUNC2(void, alGetDoublev, ALenum, ALdouble*)
FORCE_ALIGN void AL_APIENTRY alGetDoublevDirect(ALCcontext *context, ALenum pname, ALdouble *values) noexcept
{
if(!values) UNLIKELY
@@ -418,6 +423,7 @@ FORCE_ALIGN void AL_APIENTRY alGetDoublevDirect(ALCcontext *context, ALenum pnam
GetValue(context, pname, values);
}
+AL_API DECL_FUNC2(void, alGetFloatv, ALenum, ALfloat*)
FORCE_ALIGN void AL_APIENTRY alGetFloatvDirect(ALCcontext *context, ALenum pname, ALfloat *values) noexcept
{
if(!values) UNLIKELY
@@ -425,6 +431,7 @@ FORCE_ALIGN void AL_APIENTRY alGetFloatvDirect(ALCcontext *context, ALenum pname
GetValue(context, pname, values);
}
+AL_API DECL_FUNC2(void, alGetIntegerv, ALenum, ALint*)
FORCE_ALIGN void AL_APIENTRY alGetIntegervDirect(ALCcontext *context, ALenum pname, ALint *values) noexcept
{
if(!values) UNLIKELY
@@ -432,6 +439,7 @@ FORCE_ALIGN void AL_APIENTRY alGetIntegervDirect(ALCcontext *context, ALenum pna
GetValue(context, pname, values);
}
+AL_API DECL_FUNCEXT2(void, alGetInteger64v,SOFT, ALenum, ALint64SOFT*)
FORCE_ALIGN void AL_APIENTRY alGetInteger64vDirectSOFT(ALCcontext *context, ALenum pname, ALint64SOFT *values) noexcept
{
if(!values) UNLIKELY
@@ -439,6 +447,7 @@ FORCE_ALIGN void AL_APIENTRY alGetInteger64vDirectSOFT(ALCcontext *context, ALen
GetValue(context, pname, values);
}
+AL_API DECL_FUNCEXT2(void, alGetPointerv,SOFT, ALenum, ALvoid**)
FORCE_ALIGN void AL_APIENTRY alGetPointervDirectSOFT(ALCcontext *context, ALenum pname, ALvoid **values) noexcept
{
if(!values) UNLIKELY
@@ -467,6 +476,7 @@ FORCE_ALIGN void AL_APIENTRY alGetPointervDirectSOFT(ALCcontext *context, ALenum
}
}
+AL_API DECL_FUNC1(const ALchar*, alGetString, ALenum)
FORCE_ALIGN const ALchar* AL_APIENTRY alGetStringDirect(ALCcontext *context, ALenum pname) noexcept
{
const ALchar *value{nullptr};
@@ -526,6 +536,7 @@ FORCE_ALIGN const ALchar* AL_APIENTRY alGetStringDirect(ALCcontext *context, ALe
return value;
}
+AL_API DECL_FUNC1(void, alDopplerFactor, ALfloat)
FORCE_ALIGN void AL_APIENTRY alDopplerFactorDirect(ALCcontext *context, ALfloat value) noexcept
{
if(!(value >= 0.0f && std::isfinite(value)))
@@ -538,6 +549,7 @@ FORCE_ALIGN void AL_APIENTRY alDopplerFactorDirect(ALCcontext *context, ALfloat
}
}
+AL_API DECL_FUNC1(void, alSpeedOfSound, ALfloat)
FORCE_ALIGN void AL_APIENTRY alSpeedOfSoundDirect(ALCcontext *context, ALfloat value) noexcept
{
if(!(value > 0.0f && std::isfinite(value)))
@@ -550,6 +562,7 @@ FORCE_ALIGN void AL_APIENTRY alSpeedOfSoundDirect(ALCcontext *context, ALfloat v
}
}
+AL_API DECL_FUNC1(void, alDistanceModel, ALenum)
FORCE_ALIGN void AL_APIENTRY alDistanceModelDirect(ALCcontext *context, ALenum value) noexcept
{
if(auto model = DistanceModelFromALenum(value))
@@ -564,12 +577,14 @@ FORCE_ALIGN void AL_APIENTRY alDistanceModelDirect(ALCcontext *context, ALenum v
}
+AL_API DECL_FUNCEXT(void, alDeferUpdates,SOFT)
FORCE_ALIGN void AL_APIENTRY alDeferUpdatesDirectSOFT(ALCcontext *context) noexcept
{
std::lock_guard<std::mutex> _{context->mPropLock};
context->deferUpdates();
}
+AL_API DECL_FUNCEXT(void, alProcessUpdates,SOFT)
FORCE_ALIGN void AL_APIENTRY alProcessUpdatesDirectSOFT(ALCcontext *context) noexcept
{
std::lock_guard<std::mutex> _{context->mPropLock};
@@ -577,6 +592,7 @@ FORCE_ALIGN void AL_APIENTRY alProcessUpdatesDirectSOFT(ALCcontext *context) noe
}
+AL_API DECL_FUNCEXT2(const ALchar*, alGetStringi,SOFT, ALenum,ALsizei)
FORCE_ALIGN const ALchar* AL_APIENTRY alGetStringiDirectSOFT(ALCcontext *context, ALenum pname, ALsizei index) noexcept
{
const ALchar *value{nullptr};
@@ -595,22 +611,6 @@ FORCE_ALIGN const ALchar* AL_APIENTRY alGetStringiDirectSOFT(ALCcontext *context
return value;
}
-AL_API DECL_FUNC1(void, alEnable, ALenum)
-AL_API DECL_FUNC1(void, alDisable, ALenum)
-AL_API DECL_FUNC1(ALboolean, alIsEnabled, ALenum)
-AL_API DECL_FUNC2(void, alGetBooleanv, ALenum, ALboolean*)
-AL_API DECL_FUNC2(void, alGetDoublev, ALenum, ALdouble*)
-AL_API DECL_FUNC2(void, alGetFloatv, ALenum, ALfloat*)
-AL_API DECL_FUNC2(void, alGetIntegerv, ALenum, ALint*)
-AL_API DECL_FUNCEXT2(void, alGetInteger64v,SOFT, ALenum, ALint64SOFT*)
-AL_API DECL_FUNCEXT2(void, alGetPointerv,SOFT, ALenum, ALvoid**)
-AL_API DECL_FUNC1(const ALchar*, alGetString, ALenum)
-AL_API DECL_FUNC1(void, alDopplerFactor, ALfloat)
-AL_API DECL_FUNC1(void, alSpeedOfSound, ALfloat)
-AL_API DECL_FUNC1(void, alDistanceModel, ALenum)
-AL_API DECL_FUNCEXT(void, alDeferUpdates,SOFT)
-AL_API DECL_FUNCEXT(void, alProcessUpdates,SOFT)
-AL_API DECL_FUNCEXT2(const ALchar*, alGetStringi,SOFT, ALenum,ALsizei)
AL_API void AL_APIENTRY alDopplerVelocity(ALfloat value) noexcept
{