diff options
author | Chris Robinson <[email protected]> | 2019-08-02 12:38:20 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-02 12:38:20 -0700 |
commit | 9f223898f2f460d707d8506e28989d2952a767f9 (patch) | |
tree | 2b5bb8ac198a8b61fa243e8fe730008154393840 /al/source.h | |
parent | ce7c86b21731b026f12f53dda42b9553ebd94fee (diff) |
Use an unsigned voice index
Diffstat (limited to 'al/source.h')
-rw-r--r-- | al/source.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/al/source.h b/al/source.h index 1aafafab..a5d10cf9 100644 --- a/al/source.h +++ b/al/source.h @@ -20,6 +20,7 @@ struct ALeffectslot; #define DEFAULT_SENDS 2 +#define INVALID_VOICE_IDX static_cast<ALuint>(-1) struct ALbufferlistitem { using element_type = ALbuffer*; @@ -139,27 +140,27 @@ struct ALsource { * Last user-specified offset, and the offset type (bytes, samples, or * seconds). */ - ALdouble Offset; - ALenum OffsetType; + ALdouble Offset{0.0}; + ALenum OffsetType{AL_NONE}; /** Source type (static, streaming, or undetermined) */ - ALint SourceType; + ALint SourceType{AL_UNDETERMINED}; /** Source state (initial, playing, paused, or stopped) */ - ALenum state; + ALenum state{AL_INITIAL}; /** Source Buffer Queue head. */ - ALbufferlistitem *queue; + ALbufferlistitem *queue{nullptr}; std::atomic_flag PropsClean; /* Index into the context's Voices array. Lazily updated, only checked and * reset when looking up the voice. */ - ALint VoiceIdx; + ALuint VoiceIdx{INVALID_VOICE_IDX}; /** Self ID */ - ALuint id; + ALuint id{0}; ALsource(ALsizei num_sends); |