diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-03-27 16:39:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 16:39:03 +0100 |
commit | 2498151cd66a4ae2c772f31b0171e1aea5e63b27 (patch) | |
tree | cef3e6c7323620b8f7c1db1da81ee944925a499e /scene/2d | |
parent | 6574c557c962d9e4dd726b494322aea246a0245a (diff) | |
parent | 24b7f088927e17d80e1e21573b16bee8d3d5d50b (diff) |
Merge pull request #27259 from humblers/fix-cpuparticles
Ensure non-emitting particles not processed on entering tree
Diffstat (limited to 'scene/2d')
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 05c2253a5b..721b52edaa 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -37,7 +37,8 @@ void CPUParticles2D::set_emitting(bool p_emitting) { emitting = p_emitting; - set_process_internal(true); + if (emitting) + set_process_internal(true); } void CPUParticles2D::set_amount(int p_amount) { @@ -965,7 +966,7 @@ void CPUParticles2D::_update_render_thread() { void CPUParticles2D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { - _set_redraw(true); + set_process_internal(emitting); } if (p_what == NOTIFICATION_EXIT_TREE) { @@ -1001,7 +1002,6 @@ void CPUParticles2D::_notification(int p_what) { float delta = get_process_delta_time(); if (emitting) { - _set_redraw(true); inactive_time = 0; } else { inactive_time += delta; @@ -1017,6 +1017,7 @@ void CPUParticles2D::_notification(int p_what) { return; } } + _set_redraw(true); if (time == 0 && pre_process_time > 0.0) { |