diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/particles_2d.cpp | 7 | ||||
-rw-r--r-- | scene/2d/particles_2d.h | 1 | ||||
-rw-r--r-- | scene/3d/particles.cpp | 7 | ||||
-rw-r--r-- | scene/3d/particles.h | 1 |
4 files changed, 6 insertions, 10 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 7d53557216..cc3829ad07 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -35,8 +35,7 @@ void Particles2D::set_emitting(bool p_emitting) { - emitting = p_emitting; - VS::get_singleton()->particles_set_emitting(particles, emitting); + VS::get_singleton()->particles_set_emitting(particles, p_emitting); } void Particles2D::set_amount(int p_amount) { @@ -56,7 +55,7 @@ void Particles2D::set_one_shot(bool p_enable) { one_shot = p_enable; VS::get_singleton()->particles_set_one_shot(particles, one_shot); - if (!one_shot && emitting) + if (!one_shot && is_emitting()) VisualServer::get_singleton()->particles_restart(particles); } void Particles2D::set_pre_process_time(float p_time) { @@ -134,7 +133,7 @@ void Particles2D::set_speed_scale(float p_scale) { bool Particles2D::is_emitting() const { - return emitting; + return VS::get_singleton()->particles_get_emitting(particles); } int Particles2D::get_amount() const { diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index 6946f2a799..455a663693 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -47,7 +47,6 @@ public: private: RID particles; - bool emitting; bool one_shot; int amount; float lifetime; diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index b445ccc5a9..9108973cbf 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -42,8 +42,7 @@ PoolVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const { void Particles::set_emitting(bool p_emitting) { - emitting = p_emitting; - VS::get_singleton()->particles_set_emitting(particles, emitting); + VS::get_singleton()->particles_set_emitting(particles, p_emitting); } void Particles::set_amount(int p_amount) { @@ -63,7 +62,7 @@ void Particles::set_one_shot(bool p_one_shot) { one_shot = p_one_shot; VS::get_singleton()->particles_set_one_shot(particles, one_shot); - if (!one_shot && emitting) + if (!one_shot && is_emitting()) VisualServer::get_singleton()->particles_restart(particles); } @@ -113,7 +112,7 @@ void Particles::set_speed_scale(float p_scale) { bool Particles::is_emitting() const { - return emitting; + return VS::get_singleton()->particles_get_emitting(particles); } int Particles::get_amount() const { diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 5b8121e937..24154b5607 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -57,7 +57,6 @@ public: private: RID particles; - bool emitting; bool one_shot; int amount; float lifetime; |