Skip to content

Commit

Permalink
create segment buffer if not set up already
Browse files Browse the repository at this point in the history
up to 30% faster, and prevents interference with other segments.
  • Loading branch information
softhack007 committed Nov 24, 2024
1 parent 0b9adf9 commit 540b580
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wled00/FX_2Dfcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ void Segment::startFrame(void) {

// WLEDMM Waterfall mapping
if (!_is2Deffect && (map1D2D == M12_pBar) && reverse) { // WLEDMM Waterfall = bar + reverse
if (!ledsrgb || (ledsrgbSize == 0)) setUpLeds(); // create segment buffer if not set up already ==> 30% faster, and prevents interference with other segments.
for (unsigned myRow = _2dHeight-1; myRow > 0; myRow--)
for (unsigned myCol = 0; myCol < _2dWidth; myCol++) {
setPixelColorXY(myCol, myRow, getPixelColorXY(int(myCol), int(myRow)-1));
Expand Down

0 comments on commit 540b580

Please sign in to comment.