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

Method RecycleParticleBuffer

Source/Engine/Particles/Particles.cpp:1503–1523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1501}
1502
1503void Particles::RecycleParticleBuffer(ParticleBuffer* buffer)
1504{
1505 PROFILE_CPU();
1506 PROFILE_MEM(Particles);
1507 if (buffer->Emitter->EnablePooling && EnableParticleBufferPooling)
1508 {
1509 // Return to pool
1510 EmitterCache c;
1511 c.LastTimeUsed = Platform::GetTimeSeconds();
1512 c.Buffer = buffer;
1513
1514 PoolLocker.Lock();
1515 Pool[buffer->Emitter].Add(c);
1516 PoolLocker.Unlock();
1517 }
1518 else
1519 {
1520 // Destroy
1521 Delete(buffer);
1522 }
1523}
1524
1525void Particles::OnEmitterUnload(ParticleEmitter* emitter)
1526{

Callers

nothing calls this directly

Calls 4

DeleteFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected