summaryrefslogtreecommitdiffstats
path: root/scene/2d/cpu_particles_2d.cpp
diff options
context:
space:
mode:
authorDaeil Kim <kiidmale@gmail.com>2019-03-20 18:50:56 +0900
committerDaeil Kim <kiidmale@gmail.com>2019-03-20 21:54:00 +0900
commit24b7f088927e17d80e1e21573b16bee8d3d5d50b (patch)
tree7d183ebbb16515e49fe30a91e96e0f552816c86e /scene/2d/cpu_particles_2d.cpp
parenta53645e726097e9020d12df886b62431cb1740b9 (diff)
downloadredot-engine-24b7f088927e17d80e1e21573b16bee8d3d5d50b.tar.gz
Ensure non-emitting particles not processed on entering tree
Also removed non-active CPUParticles(3d) from render list Fixes #27066
Diffstat (limited to 'scene/2d/cpu_particles_2d.cpp')
-rw-r--r--scene/2d/cpu_particles_2d.cpp7
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) {