MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / AllocEffect

Function AllocEffect

Engine/lib/openal-soft/al/effect.cpp:180–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178}
179
180ALeffect *AllocEffect(ALCdevice *device)
181{
182 auto sublist = std::find_if(device->EffectList.begin(), device->EffectList.end(),
183 [](const EffectSubList &entry) noexcept -> bool
184 { return entry.FreeMask != 0; }
185 );
186 auto lidx = static_cast<ALuint>(std::distance(device->EffectList.begin(), sublist));
187 auto slidx = static_cast<ALuint>(al::countr_zero(sublist->FreeMask));
188
189 ALeffect *effect{::new (sublist->Effects + slidx) ALeffect{}};
190 InitEffectParams(effect, AL_EFFECT_NULL);
191
192 /* Add 1 to avoid effect ID 0. */
193 effect->id = ((lidx<<6) | slidx) + 1;
194
195 sublist->FreeMask &= ~(1_u64 << slidx);
196
197 return effect;
198}
199
200void FreeEffect(ALCdevice *device, ALeffect *effect)
201{

Callers 1

effect.cppFile · 0.85

Calls 5

countr_zeroFunction · 0.85
InitEffectParamsFunction · 0.85
distanceFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected