diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-04-07 11:27:29 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-05-08 14:03:04 +0000 |
commit | 928c1584b67cb93a2c1e180a73574a84b4e7af01 (patch) | |
tree | f1619940e83fb21871a1fd6993c78a2d092759e0 /src/particleemitterprop.h | |
parent | 13a0a505bde8868e7ac9d50aa7dfe7d6bbae60c4 (diff) | |
download | mana-particle-system.tar.gz mana-particle-system.tar.bz2 mana-particle-system.tar.xz mana-particle-system.zip |
ParticleEmitter cleanupsparticle-system
* Don't needlessly use explicit heap allocation for ParticleEmitter
instances.
* Initialize ParticleEmitter members at the definition.
Diffstat (limited to 'src/particleemitterprop.h')
-rw-r--r-- | src/particleemitterprop.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/particleemitterprop.h b/src/particleemitterprop.h index 78f349b8..6a9d6ecb 100644 --- a/src/particleemitterprop.h +++ b/src/particleemitterprop.h @@ -37,17 +37,20 @@ enum ChangeFunc template <typename T> struct ParticleEmitterProp { + explicit ParticleEmitterProp(T value = T()) + : ParticleEmitterProp(value, value) + {} + + ParticleEmitterProp(T min, T max) + : minVal(min), maxVal(max) + {} + void set(T min, T max) { minVal = min; maxVal = max; } - void set(T val) - { - set(val, val); - } - void setFunction(ChangeFunc func, T amplitude, int period, int phase) { changeFunc = func; |