From 191150d9a8e5dea9350030c8d4cade37fcad1695 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 20 Sep 2020 04:11:52 -0700 Subject: Remove deprecated, performance, and error event types These would be better served with a proper debug API, rather than a general audio event API. --- al/error.cpp | 11 ----------- al/event.cpp | 6 ------ al/event.h | 5 +---- al/state.cpp | 14 -------------- 4 files changed, 1 insertion(+), 35 deletions(-) (limited to 'al') diff --git a/al/error.cpp b/al/error.cpp index b667d14f..79bbc56c 100644 --- a/al/error.cpp +++ b/al/error.cpp @@ -38,8 +38,6 @@ #include "alcontext.h" #include "alexcpt.h" #include "almalloc.h" -#include "event.h" -#include "inprogext.h" #include "logging.h" #include "opthelpers.h" #include "vector.h" @@ -65,7 +63,6 @@ void ALCcontext::setError(ALenum errorCode, const char *msg, ...) if(msglen >= 0) msg = message.data(); else msg = ""; - msglen = static_cast(strlen(msg)); WARN("Error generated on context %p, code 0x%04x, \"%s\"\n", decltype(std::declval()){this}, errorCode, msg); @@ -82,14 +79,6 @@ void ALCcontext::setError(ALenum errorCode, const char *msg, ...) ALenum curerr{AL_NO_ERROR}; mLastError.compare_exchange_strong(curerr, errorCode); - if((mEnabledEvts.load(std::memory_order_relaxed)&EventType_Error)) - { - std::lock_guard _{mEventCbLock}; - ALbitfieldSOFT enabledevts{mEnabledEvts.load(std::memory_order_relaxed)}; - if((enabledevts&EventType_Error) && mEventCb) - (*mEventCb)(AL_EVENT_TYPE_ERROR_SOFT, 0, static_cast(errorCode), msglen, msg, - mEventParam); - } } AL_API ALenum AL_APIENTRY alGetError(void) diff --git a/al/event.cpp b/al/event.cpp index cd8ea7c2..296c64e6 100644 --- a/al/event.cpp +++ b/al/event.cpp @@ -149,12 +149,6 @@ START_API_FUNC flags |= EventType_BufferCompleted; else if(type == AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT) flags |= EventType_SourceStateChange; - else if(type == AL_EVENT_TYPE_ERROR_SOFT) - flags |= EventType_Error; - else if(type == AL_EVENT_TYPE_PERFORMANCE_SOFT) - flags |= EventType_Performance; - else if(type == AL_EVENT_TYPE_DEPRECATED_SOFT) - flags |= EventType_Deprecated; else if(type == AL_EVENT_TYPE_DISCONNECTED_SOFT) flags |= EventType_Disconnected; else diff --git a/al/event.h b/al/event.h index 44d9306f..71374618 100644 --- a/al/event.h +++ b/al/event.h @@ -16,10 +16,7 @@ enum { /* User event types. */ EventType_SourceStateChange = 1<<0, EventType_BufferCompleted = 1<<1, - EventType_Error = 1<<2, - EventType_Performance = 1<<3, - EventType_Deprecated = 1<<4, - EventType_Disconnected = 1<<5, + EventType_Disconnected = 1<<2, /* Internal events. */ EventType_ReleaseEffectState = 65536, diff --git a/al/state.cpp b/al/state.cpp index 8dda6f5f..dcc87972 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -736,20 +736,6 @@ START_API_FUNC ContextRef context{GetContextRef()}; if UNLIKELY(!context) return; - if((context->mEnabledEvts.load(std::memory_order_relaxed)&EventType_Deprecated)) - { - std::lock_guard _{context->mEventCbLock}; - ALbitfieldSOFT enabledevts{context->mEnabledEvts.load(std::memory_order_relaxed)}; - if((enabledevts&EventType_Deprecated) && context->mEventCb) - { - static const char msg[] = - "alDopplerVelocity is deprecated in AL1.1, use alSpeedOfSound"; - const ALsizei msglen{sizeof(msg)-1}; - (*context->mEventCb)(AL_EVENT_TYPE_DEPRECATED_SOFT, 0, 0, msglen, msg, - context->mEventParam); - } - } - if(!(value >= 0.0f && std::isfinite(value))) context->setError(AL_INVALID_VALUE, "Doppler velocity %f out of range", value); else -- cgit v1.2.3