MCPcopy Create free account
hub / github.com/axmolengine/axmol / UpdateSourceProps

Function UpdateSourceProps

3rdparty/openal/al/source.cpp:105–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103
104
105void UpdateSourceProps(const ALsource *source, Voice *voice, ALCcontext *context)
106{
107 /* Get an unused property container, or allocate a new one as needed. */
108 VoicePropsItem *props{context->mFreeVoiceProps.load(std::memory_order_acquire)};
109 if(!props)
110 {
111 context->allocVoiceProps();
112 props = context->mFreeVoiceProps.load(std::memory_order_acquire);
113 }
114 VoicePropsItem *next;
115 do {
116 next = props->next.load(std::memory_order_relaxed);
117 } while(context->mFreeVoiceProps.compare_exchange_weak(props, next,
118 std::memory_order_acq_rel, std::memory_order_acquire) == false);
119
120 props->Pitch = source->Pitch;
121 props->Gain = source->Gain;
122 props->OuterGain = source->OuterGain;
123 props->MinGain = source->MinGain;
124 props->MaxGain = source->MaxGain;
125 props->InnerAngle = source->InnerAngle;
126 props->OuterAngle = source->OuterAngle;
127 props->RefDistance = source->RefDistance;
128 props->MaxDistance = source->MaxDistance;
129 props->RolloffFactor = source->RolloffFactor
130#ifdef ALSOFT_EAX
131 + source->RolloffFactor2
132#endif
133 ;
134 props->Position = source->Position;
135 props->Velocity = source->Velocity;
136 props->Direction = source->Direction;
137 props->OrientAt = source->OrientAt;
138 props->OrientUp = source->OrientUp;
139 props->HeadRelative = source->HeadRelative;
140 props->mDistanceModel = source->mDistanceModel;
141 props->mResampler = source->mResampler;
142 props->DirectChannels = source->DirectChannels;
143 props->mSpatializeMode = source->mSpatialize;
144
145 props->DryGainHFAuto = source->DryGainHFAuto;
146 props->WetGainAuto = source->WetGainAuto;
147 props->WetGainHFAuto = source->WetGainHFAuto;
148 props->OuterGainHF = source->OuterGainHF;
149
150 props->AirAbsorptionFactor = source->AirAbsorptionFactor;
151 props->RoomRolloffFactor = source->RoomRolloffFactor;
152 props->DopplerFactor = source->DopplerFactor;
153
154 props->StereoPan = source->StereoPan;
155
156 props->Radius = source->Radius;
157 props->EnhWidth = source->EnhWidth;
158
159 props->Direct.Gain = source->Direct.Gain;
160 props->Direct.GainHF = source->Direct.GainHF;
161 props->Direct.HFReference = source->Direct.HFReference;
162 props->Direct.GainLF = source->Direct.GainLF;

Callers 4

InitVoiceFunction · 0.85
SetPropertyFunction · 0.85
UpdateAllSourcePropsFunction · 0.85

Calls 7

transformFunction · 0.85
AtomicReplaceHeadFunction · 0.85
GetSourceVoiceFunction · 0.85
allocVoicePropsMethod · 0.80
loadMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected