Limit the layer checking to `max_layers_`

Instead of iterating down from the 32th layer, do so from `max_layers_` instead.
Not only is this more performant, it allows us to have higher layers outside of
Colormap's control.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 7 years ago
parent abe9fcc3c7
commit f14e31fdd6

@ -47,7 +47,7 @@ void ColormapEffect::max_layers(uint8_t max_) {
}
void ColormapEffect::update(void) {
for (uint8_t l = 0; l < 32; l++) {
for (uint8_t l = 0; l < max_layers_; l++) {
if (!Layer.isOn(l))
continue;

Loading…
Cancel
Save