Matrix effect speedup
Typically, more than 50% of pixels are black. This optimization avoids to fade and rewrite already black pixels.
This commit is contained in:
parent
555dd2e726
commit
43613e3b10
@ -5218,7 +5218,7 @@ uint16_t mode_2Dmatrix(void) { // Matrix2D. By Jeremy Williams.
|
|||||||
if (row < rows-1) SEGMENT.setPixelColorXY(col, row+1, spawnColor);
|
if (row < rows-1) SEGMENT.setPixelColorXY(col, row+1, spawnColor);
|
||||||
} else {
|
} else {
|
||||||
// fade other pixels
|
// fade other pixels
|
||||||
SEGMENT.setPixelColorXY(col, row, pix.nscale8(fade));
|
if (pix != CRGB::Black) SEGMENT.setPixelColorXY(col, row, pix.nscale8(fade)); // optimization: don't fade black pixels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user