Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 630 vs 631 for /trunk/Source Code/Dynamics/Entities/Particles/ParticleSource.cpp

Diff revisions: vs.
  @@ -15,15 +15,16 @@
15 15 }
16 16
17 17 void ParticleSource::emit(const U64 deltaTime, std::shared_ptr<ParticleData> p) {
18 + ParticleData& data = *p;
19 +
18 20 const F32 dt = Time::MicrosecondsToSeconds<F32>(deltaTime);
19 21 const U32 maxNewParticles = to_uint(dt * _emitRate);
20 - const U32 startID = p->aliveCount();
21 - const U32 endID = std::min(startID + maxNewParticles, p->totalCount() - 1);
22 + const U32 startID = data.aliveCount();
23 + const U32 endID = std::min(startID + maxNewParticles, data.totalCount() - 1);
22 24
23 25 _generatorTasks.reserve(_particleGenerators.size() * (endID - startID));
24 -
25 26 for (std::shared_ptr<ParticleGenerator>& gen : _particleGenerators) {
26 - gen->generate(_generatorTasks, deltaTime, p, startID, endID);
27 + gen->generate(_generatorTasks, deltaTime, data, startID, endID);
27 28 for (std::future<void>& task : _generatorTasks) {
28 29 task.get();
29 30 }