Skip to content

Commit

Permalink
depricate sPC(float, float)
Browse files Browse the repository at this point in the history
the function is already removed in upstream.
You can use wu_pixel() instead, which is much faster and more accurate.
  • Loading branch information
softhack007 committed Sep 29, 2024
1 parent a0f07ca commit 7e9474e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wled00/FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5539,7 +5539,10 @@ uint16_t mode_2DLissajous(void) { // By: Andrew Tuline
float ylocn = float(cos8(phase/2 + i*2)) / 255.0f;
//SEGMENT.setPixelColorXY(xlocn, ylocn, SEGMENT.color_from_palette(strip.now/100+i, false, PALETTE_SOLID_WRAP, 0)); // draw pixel with anti-aliasing
unsigned palIndex = (256*ylocn) + phase/2 + (i* SEGMENT.speed)/64;
SEGMENT.setPixelColorXY(xlocn, ylocn, SEGMENT.color_from_palette(palIndex, false, PALETTE_SOLID_WRAP, 0)); // draw pixel with anti-aliasing - color follows rotation
//SEGMENT.setPixelColorXY(xlocn, ylocn, SEGMENT.color_from_palette(palIndex, false, PALETTE_SOLID_WRAP, 0)); // draw pixel with anti-aliasing - color follows rotation
// WLEDMM wu_pixel is 50% faster, and still lokks better
SEGMENT.wu_pixel(uint32_t(xlocn * (cols <<8)), uint32_t(ylocn * (rows <<8)),
CRGB(SEGMENT.color_from_palette(palIndex, false, PALETTE_SOLID_WRAP, 0)));
}
} else
for (int i=0; i < 256; i ++) {
Expand Down
3 changes: 3 additions & 0 deletions wled00/FX_2Dfcn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM:
}
}

#if 0
// WLEDMM setPixelColorXY(float x, float y, uint32_t col, ..) is depricated. use wu_pixel(x,y,col) instead.
// anti-aliased version of setPixelColorXY()
void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa, bool fast) // WLEDMM some speedups due to fast int and faster sqrt16
{
Expand Down Expand Up @@ -463,6 +465,7 @@ void Segment::setPixelColorXY(float x, float y, uint32_t col, bool aa, bool fast
setPixelColorXY(uint16_t(roundf(fX)), uint16_t(roundf(fY)), col);
}
}
#endif

// returns RGBW values of pixel
uint32_t IRAM_ATTR_YN Segment::getPixelColorXY(int x, int y) const {
Expand Down

0 comments on commit 7e9474e

Please sign in to comment.