Merge pull request #784 from romulox-x/2d-particle-depth

offset particle drawing order so that recently emitted particles are alw...
This commit is contained in:
Juan Linietsky 2014-10-13 00:22:28 -03:00
commit 13a848e332
1 changed files with 7 additions and 1 deletions

View File

@ -507,7 +507,13 @@ void Particles2D::_notification(int p_what) {
} }
for(int i=0;i<particle_count;i++) { int start_particle = (int)(time * (float)particle_count / lifetime);
for (int id=0;id<particle_count;++id) {
int i = start_particle + id;
if (i >= particle_count) {
i -= particle_count;
}
Particle &p=pdata[i]; Particle &p=pdata[i];
if (!p.active) if (!p.active)