From 5404b2225aca57407f2f3704e2e2616a281d85ae Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 23 Mar 2017 01:16:13 -0700 Subject: Add some comments for ALsource functions --- OpenAL32/alSource.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'OpenAL32') diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index e32bb5c8..a882cb83 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -139,13 +139,21 @@ static inline ALvoice *GetSourceVoice(const ALsource *source, const ALCcontext * return NULL; } +/** + * Returns if the last known state for the source was playing or paused. Does + * not sync with the mixer voice. + */ static inline bool IsPlayingOrPaused(ALsource *source) { ALenum state = ATOMIC_LOAD(&source->state, almemory_order_acquire); return state == AL_PLAYING || state == AL_PAUSED; } -static ALenum GetSourceState(ALsource *source, ALvoice *voice) +/** + * Returns an updated source state using the matching voice's status (or lack + * thereof). + */ +static inline ALenum GetSourceState(ALsource *source, ALvoice *voice) { if(!voice) { @@ -158,6 +166,10 @@ static ALenum GetSourceState(ALsource *source, ALvoice *voice) return ATOMIC_LOAD(&source->state, almemory_order_acquire); } +/** + * Returns if the source should specify an update, given the context's + * deferring state and the source's last known state. + */ static inline bool SourceShouldUpdate(ALsource *source, ALCcontext *context) { return !ATOMIC_LOAD(&context->DeferUpdates, almemory_order_acquire) && -- cgit v1.2.3