aboutsummaryrefslogtreecommitdiffstats
path: root/al/event.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'al/event.cpp')
-rw-r--r--al/event.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/al/event.cpp b/al/event.cpp
index eb6af45c..f7ef7b50 100644
--- a/al/event.cpp
+++ b/al/event.cpp
@@ -27,6 +27,7 @@
#include "core/logging.h"
#include "core/voice_change.h"
#include "debug.h"
+#include "direct_defs.h"
#include "opthelpers.h"
#include "ringbuffer.h"
#include "threads.h"
@@ -172,11 +173,11 @@ void StopEventThrd(ALCcontext *ctx)
ctx->mEventThread.join();
}
-AL_API void AL_APIENTRY alEventControlSOFT(ALsizei count, const ALenum *types, ALboolean enable)
-START_API_FUNC
+FORCE_ALIGN void AL_APIENTRY alEventControlDirectSOFT(ALCcontext *context, ALsizei count,
+ const ALenum *types, ALboolean enable) noexcept
{
- ContextRef context{GetContextRef()};
- if(!context) UNLIKELY return;
+ if(!context) UNLIKELY
+ return;
if(count < 0) context->setError(AL_INVALID_VALUE, "Controlling %d events", count);
if(count <= 0) return;
@@ -225,17 +226,18 @@ START_API_FUNC
std::lock_guard<std::mutex> _{context->mEventCbLock};
}
}
-END_API_FUNC
-AL_API void AL_APIENTRY alEventCallbackSOFT(ALEVENTPROCSOFT callback, void *userParam)
-START_API_FUNC
+FORCE_ALIGN void AL_APIENTRY alEventCallbackDirectSOFT(ALCcontext *context,
+ ALEVENTPROCSOFT callback, void *userParam) noexcept
{
- ContextRef context{GetContextRef()};
- if(!context) UNLIKELY return;
+ if(!context) UNLIKELY
+ return;
std::lock_guard<std::mutex> _{context->mPropLock};
std::lock_guard<std::mutex> __{context->mEventCbLock};
context->mEventCb = callback;
context->mEventParam = userParam;
}
-END_API_FUNC
+
+DECL_FUNCEXT3(void, alEventControl,SOFT, ALsizei, const ALenum*, ALboolean)
+DECL_FUNCEXT2(void, alEventCallback,SOFT, ALEVENTPROCSOFT, void*)