aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-02 12:38:20 -0700
committerChris Robinson <[email protected]>2019-08-02 12:38:20 -0700
commit9f223898f2f460d707d8506e28989d2952a767f9 (patch)
tree2b5bb8ac198a8b61fa243e8fe730008154393840 /al/source.cpp
parentce7c86b21731b026f12f53dda42b9553ebd94fee (diff)
Use an unsigned voice index
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 5ba36524..a021cd1a 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -75,15 +75,15 @@ using namespace std::placeholders;
inline ALvoice *GetSourceVoice(ALsource *source, ALCcontext *context)
{
- ALint idx{source->VoiceIdx};
- if(idx >= 0 && static_cast<ALuint>(idx) < context->mVoiceCount.load(std::memory_order_relaxed))
+ ALuint idx{source->VoiceIdx};
+ if(idx < context->mVoiceCount.load(std::memory_order_relaxed))
{
ALuint sid{source->id};
ALvoice &voice = (*context->mVoices)[idx];
if(voice.mSourceID.load(std::memory_order_acquire) == sid)
return &voice;
}
- source->VoiceIdx = -1;
+ source->VoiceIdx = INVALID_VOICE_IDX;
return nullptr;
}
@@ -2894,7 +2894,7 @@ START_API_FUNC
}
);
assert(voice != voices_end);
- auto vidx = static_cast<ALint>(std::distance(context->mVoices->begin(), voice));
+ auto vidx = static_cast<ALuint>(std::distance(context->mVoices->begin(), voice));
voice->mPlayState.store(ALvoice::Stopped, std::memory_order_release);
source->PropsClean.test_and_set(std::memory_order_acquire);
@@ -3554,16 +3554,7 @@ ALsource::ALsource(ALsizei num_sends)
send.LFReference = HIGHPASSFREQREF;
}
- Offset = 0.0;
- OffsetType = AL_NONE;
- SourceType = AL_UNDETERMINED;
- state = AL_INITIAL;
-
- queue = nullptr;
-
PropsClean.test_and_set(std::memory_order_relaxed);
-
- VoiceIdx = -1;
}
ALsource::~ALsource()