diff options
Diffstat (limited to 'al')
-rw-r--r-- | al/debug.cpp | 15 | ||||
-rw-r--r-- | al/state.cpp | 23 |
2 files changed, 25 insertions, 13 deletions
diff --git a/al/debug.cpp b/al/debug.cpp index fa16ff73..786fcd1f 100644 --- a/al/debug.cpp +++ b/al/debug.cpp @@ -248,6 +248,9 @@ FORCE_ALIGN void AL_APIENTRY alDebugMessageInsertEXT(ALenum source, ALenum type, ContextRef context{GetContextRef()}; if(!context) UNLIKELY return; + if(!context->mContextFlags.test(ContextFlags::DebugBit)) + return; + if(!message) return context->setError(AL_INVALID_VALUE, "Null message pointer"); @@ -416,9 +419,10 @@ FORCE_ALIGN void AL_APIENTRY alPushDebugGroupEXT(ALenum source, ALuint id, ALsiz newback.mFilters = oldback.mFilters; newback.mIdFilters = oldback.mIdFilters; - context->sendDebugMessage(debuglock, newback.mSource, DebugType::PushGroup, newback.mId, - DebugSeverity::Notification, static_cast<ALsizei>(newback.mMessage.size()), - newback.mMessage.data()); + if(context->mContextFlags.test(ContextFlags::DebugBit)) + context->sendDebugMessage(debuglock, newback.mSource, DebugType::PushGroup, newback.mId, + DebugSeverity::Notification, static_cast<ALsizei>(newback.mMessage.size()), + newback.mMessage.data()); } FORCE_ALIGN void AL_APIENTRY alPopDebugGroupEXT(void) noexcept @@ -440,8 +444,9 @@ FORCE_ALIGN void AL_APIENTRY alPopDebugGroupEXT(void) noexcept std::string message{std::move(debug.mMessage)}; context->mDebugGroups.pop_back(); - context->sendDebugMessage(debuglock, source, DebugType::PopGroup, id, - DebugSeverity::Notification, static_cast<ALsizei>(message.size()), message.data()); + if(context->mContextFlags.test(ContextFlags::DebugBit)) + context->sendDebugMessage(debuglock, source, DebugType::PopGroup, id, + DebugSeverity::Notification, static_cast<ALsizei>(message.size()), message.data()); } diff --git a/al/state.cpp b/al/state.cpp index 71c9b703..efc6398d 100644 --- a/al/state.cpp +++ b/al/state.cpp @@ -150,6 +150,7 @@ enum PropertyValue : ALenum { MaxDebugMessageLength = AL_MAX_DEBUG_MESSAGE_LENGTH_EXT, MaxDebugLoggedMessages = AL_MAX_DEBUG_LOGGED_MESSAGES_EXT, MaxDebugGroupDepth = AL_MAX_DEBUG_GROUP_STACK_DEPTH_EXT, + ContextFlags = AL_CONTEXT_FLAGS_EXT, #ifdef ALSOFT_EAX EaxRamSize = AL_EAX_RAM_SIZE, EaxRamFree = AL_EAX_RAM_FREE, @@ -183,10 +184,11 @@ void GetValue(ALCcontext *context, ALenum pname, T *values) return; case AL_DOPPLER_VELOCITY: - context->debugMessage(DebugSource::API, DebugType::DeprecatedBehavior, 0, - DebugSeverity::Medium, -1, - "AL_DOPPLER_VELOCITY is deprecated in AL 1.1, use AL_SPEED_OF_SOUND; " - "AL_DOPPLER_VELOCITY -> AL_SPEED_OF_SOUND / 343.3f"); + if(context->mContextFlags.test(ContextFlags::DebugBit)) UNLIKELY + context->debugMessage(DebugSource::API, DebugType::DeprecatedBehavior, 0, + DebugSeverity::Medium, -1, + "AL_DOPPLER_VELOCITY is deprecated in AL 1.1, use AL_SPEED_OF_SOUND; " + "AL_DOPPLER_VELOCITY -> AL_SPEED_OF_SOUND / 343.3f"); *values = cast_value(context->mDopplerVelocity); return; @@ -241,6 +243,10 @@ void GetValue(ALCcontext *context, ALenum pname, T *values) *values = cast_value(MaxDebugGroupDepth); return; + case AL_CONTEXT_FLAGS_EXT: + *values = cast_value(context->mContextFlags.to_ulong()); + return; + #ifdef ALSOFT_EAX #define EAX_ERROR "[alGetInteger] EAX not enabled." @@ -618,10 +624,11 @@ START_API_FUNC ContextRef context{GetContextRef()}; if(!context) UNLIKELY return; - context->debugMessage(DebugSource::API, DebugType::DeprecatedBehavior, 0, - DebugSeverity::Medium, -1, - "alDopplerVelocity is deprecated in AL 1.1, use alSpeedOfSound; " - "alDopplerVelocity(x) -> alSpeedOfSound(343.3f * x)"); + if(context->mContextFlags.test(ContextFlags::DebugBit)) UNLIKELY + context->debugMessage(DebugSource::API, DebugType::DeprecatedBehavior, 0, + DebugSeverity::Medium, -1, + "alDopplerVelocity is deprecated in AL 1.1, use alSpeedOfSound; " + "alDopplerVelocity(x) -> alSpeedOfSound(343.3f * x)"); if(!(value >= 0.0f && std::isfinite(value))) context->setError(AL_INVALID_VALUE, "Doppler velocity %f out of range", value); |