From d08219584d7e16e739a22703543a5f3c361906e7 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 11 Nov 2019 03:29:11 +0100 Subject: [PATCH] particles: combine two soft_start() overloads created by #769 --- panda/src/particlesystem/particleSystem.I | 23 ++++++++--------------- panda/src/particlesystem/particleSystem.h | 3 +-- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/panda/src/particlesystem/particleSystem.I b/panda/src/particlesystem/particleSystem.I index 731ae9d7dcb..5ca800729db 100644 --- a/panda/src/particlesystem/particleSystem.I +++ b/panda/src/particlesystem/particleSystem.I @@ -48,25 +48,18 @@ clear_to_initial() { } /** - * Causes system to use birth rate set by set_birth_rate() - */ -INLINE void ParticleSystem:: -soft_start(PN_stdfloat br) { - if (br > 0.0) - set_birth_rate(br); - _cur_birth_rate = _birth_rate; - _tics_since_birth = 0.0f; -} - -/** - * Causes system to use birth rate set by set_birth_rate(), with the system's - * first birth being delayed by the value of first_birth_delay. Note that a - * negative delay is perfectly valid, causing the first birth to happen + * Causes system to use birth rate set by set_birth_rate(). + * If first_birth_delay is specified, it specifies the number of seconds to wait + * in addition to the birth rate before the first particle is birthed. It is + * legal for this to be a negative value, which causes the first birth to happen * sooner rather than later. */ INLINE void ParticleSystem:: soft_start(PN_stdfloat br, PN_stdfloat first_birth_delay) { - soft_start(br); + if (br > 0.0) { + set_birth_rate(br); + } + _cur_birth_rate = _birth_rate; _tics_since_birth = -first_birth_delay; } diff --git a/panda/src/particlesystem/particleSystem.h b/panda/src/particlesystem/particleSystem.h index 23e6f5ce828..7518bbfd9ad 100644 --- a/panda/src/particlesystem/particleSystem.h +++ b/panda/src/particlesystem/particleSystem.h @@ -96,8 +96,7 @@ class EXPCL_PANDA_PARTICLESYSTEM ParticleSystem : public Physical { INLINE void induce_labor(); INLINE void clear_to_initial(); INLINE void soft_stop(PN_stdfloat br = 0.0); - INLINE void soft_start(PN_stdfloat br = 0.0); - INLINE void soft_start(PN_stdfloat br, PN_stdfloat first_birth_delay); + INLINE void soft_start(PN_stdfloat br = 0.0, PN_stdfloat first_birth_delay = 0.0); void update(PN_stdfloat dt); virtual void output(std::ostream &out) const;