diff options
author | Chris Robinson <[email protected]> | 2014-07-21 23:14:48 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-07-22 00:20:28 -0700 |
commit | 5a339a2a5b12545c105a2a3dcfb1d8e466b0381f (patch) | |
tree | 95dab694ebe14d41e3e775dc651d07ee26cbe44a /OpenAL32/alSource.c | |
parent | 7b41ed7ec4bfb7e8ac3daef3eebc6831b96a8fa4 (diff) |
Add macros for generic atomic functionality
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 9f6c6a8b..a0a7e504 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -375,98 +375,98 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp CHECKVAL(*values >= 0.0f); Source->Pitch = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_CONE_INNER_ANGLE: CHECKVAL(*values >= 0.0f && *values <= 360.0f); Source->InnerAngle = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_CONE_OUTER_ANGLE: CHECKVAL(*values >= 0.0f && *values <= 360.0f); Source->OuterAngle = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_GAIN: CHECKVAL(*values >= 0.0f); Source->Gain = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_MAX_DISTANCE: CHECKVAL(*values >= 0.0f); Source->MaxDistance = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_ROLLOFF_FACTOR: CHECKVAL(*values >= 0.0f); Source->RollOffFactor = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_REFERENCE_DISTANCE: CHECKVAL(*values >= 0.0f); Source->RefDistance = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_MIN_GAIN: CHECKVAL(*values >= 0.0f && *values <= 1.0f); Source->MinGain = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_MAX_GAIN: CHECKVAL(*values >= 0.0f && *values <= 1.0f); Source->MaxGain = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_CONE_OUTER_GAIN: CHECKVAL(*values >= 0.0f && *values <= 1.0f); Source->OuterGain = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_CONE_OUTER_GAINHF: CHECKVAL(*values >= 0.0f && *values <= 1.0f); Source->OuterGainHF = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_AIR_ABSORPTION_FACTOR: CHECKVAL(*values >= 0.0f && *values <= 10.0f); Source->AirAbsorptionFactor = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_ROOM_ROLLOFF_FACTOR: CHECKVAL(*values >= 0.0f && *values <= 10.0f); Source->RoomRolloffFactor = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_DOPPLER_FACTOR: CHECKVAL(*values >= 0.0f && *values <= 1.0f); Source->DopplerFactor = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_SEC_OFFSET: @@ -505,7 +505,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp Source->Position[1] = values[1]; Source->Position[2] = values[2]; UnlockContext(Context); - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_VELOCITY: @@ -516,7 +516,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp Source->Velocity[1] = values[1]; Source->Velocity[2] = values[2]; UnlockContext(Context); - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_DIRECTION: @@ -527,7 +527,7 @@ static ALboolean SetSourcefv(ALsource *Source, ALCcontext *Context, SrcFloatProp Source->Orientation[1] = values[1]; Source->Orientation[2] = values[2]; UnlockContext(Context); - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; @@ -574,7 +574,7 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p CHECKVAL(*values == AL_FALSE || *values == AL_TRUE); Source->HeadRelative = (ALboolean)*values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_LOOPING: @@ -692,35 +692,35 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p Source->Direct.LFReference = filter->LFReference; } UnlockContext(Context); - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_DIRECT_FILTER_GAINHF_AUTO: CHECKVAL(*values == AL_FALSE || *values == AL_TRUE); Source->DryGainHFAuto = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_AUXILIARY_SEND_FILTER_GAIN_AUTO: CHECKVAL(*values == AL_FALSE || *values == AL_TRUE); Source->WetGainAuto = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO: CHECKVAL(*values == AL_FALSE || *values == AL_TRUE); Source->WetGainHFAuto = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_DIRECT_CHANNELS_SOFT: CHECKVAL(*values == AL_FALSE || *values == AL_TRUE); Source->DirectChannels = *values; - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; case AL_DISTANCE_MODEL: @@ -734,7 +734,7 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p Source->DistanceModel = *values; if(Context->SourceDistanceModel) - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; @@ -770,8 +770,8 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SrcIntProp p Source->Send[values[1]].GainLF = filter->GainLF; Source->Send[values[1]].LFReference = filter->LFReference; } - Source->NeedsUpdate = AL_TRUE; UnlockContext(Context); + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); return AL_TRUE; @@ -2435,7 +2435,7 @@ static ALvoid InitSourceParams(ALsource *Source) Source->Send[i].LFReference = HIGHPASSFREQREF; } - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE_UNSAFE(Source->NeedsUpdate, AL_TRUE); } @@ -2530,7 +2530,7 @@ ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state) src->Send[i].Moving = AL_FALSE; } } - Source->NeedsUpdate = AL_TRUE; + ATOMIC_STORE(Source->NeedsUpdate, AL_TRUE); } else if(state == AL_PAUSED) { |