diff options
Diffstat (limited to 'al')
-rw-r--r-- | al/source.cpp | 8 | ||||
-rw-r--r-- | al/source.h | 6 |
2 files changed, 6 insertions, 8 deletions
diff --git a/al/source.cpp b/al/source.cpp index 8ad02321..fe5bba40 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -78,8 +78,6 @@ #include <cassert> #endif // ALSOFT_EAX -bool sBufferSubDataCompat{false}; - namespace { using namespace std::placeholders; @@ -97,7 +95,7 @@ Voice *GetSourceVoice(ALsource *source, ALCcontext *context) if(voice->mSourceID.load(std::memory_order_acquire) == sid) return voice; } - source->VoiceIdx = INVALID_VOICE_IDX; + source->VoiceIdx = InvalidVoiceIndex; return nullptr; } @@ -3310,7 +3308,7 @@ FORCE_ALIGN void AL_APIENTRY alSourceStopvDirect(ALCcontext *context, ALsizei n, } source->Offset = 0.0; source->OffsetType = AL_NONE; - source->VoiceIdx = INVALID_VOICE_IDX; + source->VoiceIdx = InvalidVoiceIndex; } if(tail) LIKELY SendVoiceChanges(context, tail); @@ -3371,7 +3369,7 @@ FORCE_ALIGN void AL_APIENTRY alSourceRewindvDirect(ALCcontext *context, ALsizei } source->Offset = 0.0; source->OffsetType = AL_NONE; - source->VoiceIdx = INVALID_VOICE_IDX; + source->VoiceIdx = InvalidVoiceIndex; } if(tail) LIKELY SendVoiceChanges(context, tail); diff --git a/al/source.h b/al/source.h index 95978ec7..c7694f83 100644 --- a/al/source.h +++ b/al/source.h @@ -39,9 +39,9 @@ enum class SourceStereo : bool { #define DEFAULT_SENDS 2 -#define INVALID_VOICE_IDX static_cast<ALuint>(-1) +inline constexpr ALuint InvalidVoiceIndex{std::numeric_limits<ALuint>::max()}; -extern bool sBufferSubDataCompat; +inline bool sBufferSubDataCompat{false}; struct ALbufferQueueItem : public VoiceBufferItem { ALbuffer *mBuffer{nullptr}; @@ -145,7 +145,7 @@ struct ALsource { /* Index into the context's Voices array. Lazily updated, only checked and * reset when looking up the voice. */ - ALuint VoiceIdx{INVALID_VOICE_IDX}; + ALuint VoiceIdx{InvalidVoiceIndex}; /** Self ID */ ALuint id{0}; |