MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnEmitterUnload

Method OnEmitterUnload

Source/Engine/Particles/Particles.cpp:1525–1550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1523}
1524
1525void Particles::OnEmitterUnload(ParticleEmitter* emitter)
1526{
1527 PROFILE_CPU();
1528 PoolLocker.Lock();
1529 const auto entries = Pool.TryGet(emitter);
1530 if (entries)
1531 {
1532 for (int32 i = 0; i < entries->Count(); i++)
1533 {
1534 Delete(entries->At(i).Buffer);
1535 }
1536 entries->Clear();
1537 Pool.Remove(emitter);
1538 }
1539 PoolLocker.Unlock();
1540
1541#if COMPILE_WITH_GPU_PARTICLES
1542 GpuUpdateListLocker.Lock();
1543 for (int32 i = GpuUpdateList.Count() - 1; i >= 0; i--)
1544 {
1545 if (GpuUpdateList[i]->Instance.ContainsEmitter(emitter))
1546 GpuUpdateList.RemoveAt(i);
1547 }
1548 GpuUpdateListLocker.Unlock();
1549#endif
1550}
1551
1552bool ParticleManagerService::Init()
1553{

Callers

nothing calls this directly

Calls 9

DeleteFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
ContainsEmitterMethod · 0.80
TryGetMethod · 0.45
CountMethod · 0.45
ClearMethod · 0.45
RemoveMethod · 0.45
RemoveAtMethod · 0.45

Tested by

no test coverage detected