MCPcopy Create free account
hub / github.com/carbonengine/trinity / InsertParticle

Method InsertParticle

trinity/Particle/Tr2ParticleSystem.cpp:1293–1316  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------- Description: Inserts a new particle to the system. Arguments: paticle - (out) New particle data: array ofTr2ParticleElementData::COUNT of pointers to particle buffers. Return Value: true If particle was inserted false If the system is full -------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1291// false If the system is full
1292// --------------------------------------------------------------------------------------
1293bool Tr2ParticleSystem::InsertParticle( float** particle )
1294{
1295 if( m_insertDeleteMutex )
1296 {
1297 m_insertDeleteMutex->Acquire();
1298 }
1299
1300 if( m_aliveCount < m_maxParticleCount )
1301 {
1302 for( unsigned i = 0; i < Tr2ParticleElementData::COUNT; ++i )
1303 {
1304 particle[i] = m_buffers[i] + m_aliveCount * m_vertexSizes[i];
1305 }
1306 m_aliveCount++;
1307 m_peakAliveCount = std::max( m_peakAliveCount, m_aliveCount );
1308 m_bufferDirty = true;
1309 return true;
1310 }
1311 if( m_insertDeleteMutex )
1312 {
1313 m_insertDeleteMutex->Release();
1314 }
1315 return false;
1316}
1317
1318// --------------------------------------------------------------------------------------
1319// Description:

Callers 4

SpawnMethod · 0.80
DoSpawnMethod · 0.80
SpawnParticlesMethod · 0.80
AddParticlesMethod · 0.80

Calls 1

ReleaseMethod · 0.80

Tested by

no test coverage detected