Unify error condition for particles trail lifetime
(cherry picked from commit 78ecdb17f9
)
This commit is contained in:
parent
55ae2a3297
commit
d6d8f6a637
|
@ -149,7 +149,7 @@ void GPUParticles2D::set_trail_enabled(bool p_enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUParticles2D::set_trail_lifetime(double p_seconds) {
|
void GPUParticles2D::set_trail_lifetime(double p_seconds) {
|
||||||
ERR_FAIL_COND(p_seconds < 0.001);
|
ERR_FAIL_COND(p_seconds < 0.01);
|
||||||
trail_lifetime = p_seconds;
|
trail_lifetime = p_seconds;
|
||||||
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
|
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
|
||||||
queue_redraw();
|
queue_redraw();
|
||||||
|
|
|
@ -181,7 +181,7 @@ void GPUParticles3D::set_trail_enabled(bool p_enabled) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPUParticles3D::set_trail_lifetime(double p_seconds) {
|
void GPUParticles3D::set_trail_lifetime(double p_seconds) {
|
||||||
ERR_FAIL_COND(p_seconds < 0.001);
|
ERR_FAIL_COND(p_seconds < 0.01);
|
||||||
trail_lifetime = p_seconds;
|
trail_lifetime = p_seconds;
|
||||||
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
|
RS::get_singleton()->particles_set_trails(particles, trail_enabled, trail_lifetime);
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,7 +430,7 @@ void ParticlesStorage::particles_set_fractional_delta(RID p_particles, bool p_en
|
||||||
void ParticlesStorage::particles_set_trails(RID p_particles, bool p_enable, double p_length) {
|
void ParticlesStorage::particles_set_trails(RID p_particles, bool p_enable, double p_length) {
|
||||||
Particles *particles = particles_owner.get_or_null(p_particles);
|
Particles *particles = particles_owner.get_or_null(p_particles);
|
||||||
ERR_FAIL_COND(!particles);
|
ERR_FAIL_COND(!particles);
|
||||||
ERR_FAIL_COND(p_length < 0.1);
|
ERR_FAIL_COND(p_length < 0.01);
|
||||||
p_length = MIN(10.0, p_length);
|
p_length = MIN(10.0, p_length);
|
||||||
|
|
||||||
particles->trails_enabled = p_enable;
|
particles->trails_enabled = p_enable;
|
||||||
|
|
Loading…
Reference in New Issue