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:
commit
13a848e332
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue