-------------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------
| 1291 | // false If the system is full |
| 1292 | // -------------------------------------------------------------------------------------- |
| 1293 | bool 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: |
no test coverage detected