MCPcopy Create free account
hub / github.com/FastLED/FastLED / setMaxParticles

Method setMaxParticles

src/fl/fx/2d/luminova.cpp.hpp:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void Luminova::setMaxParticles(int max_particles) {
33 if (max_particles <= 0) {
34 max_particles = 1;
35 }
36 if (static_cast<int>(mParticles.size()) == max_particles) {
37 return;
38 }
39 mParticles.clear();
40 mParticles.resize(static_cast<size_t>(max_particles));
41 for (size_t i = 0; i < mParticles.size(); ++i) {
42 mParticles[i].alive = false;
43 }
44}
45
46void Luminova::resetParticle(Particle &p, fl::u32 tt) {
47 // Position at center

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
clearMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected