From 7a83f1759dbf98fa95e3b58bb4967421f1d37b0d Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 16 Jul 2024 20:26:52 +0200 Subject: [PATCH] removed a/b testing via Reverse X (segment option) --- wled00/FX_2Dfcn.cpp | 6 +++--- wled00/FX_fcn.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp index f6605029..900933f5 100644 --- a/wled00/FX_2Dfcn.cpp +++ b/wled00/FX_2Dfcn.cpp @@ -249,7 +249,7 @@ void IRAM_ATTR Segment::setPixelColorXY_fast(int x, int y, uint32_t col, uint32_ #endif #if 0 // this is still a dangerous optimization - if ((i < UINT_MAX) && sameColor && (call > 0) && (!transitional) && (ledsrgb[i] == CRGB(col)) && (_globalLeds == nullptr)) return; // WLEDMM looks like nothing to do (but we don't trust globalleds) + if ((i < UINT_MAX) && sameColor && (call > 0) && (!transitional) && (ledsrgb[i] == CRGB(scaled_col))) return; // WLEDMM looks like nothing to do #endif // handle reverse and transpose @@ -304,7 +304,7 @@ void IRAM_ATTR_YN Segment::setPixelColorXY(int x, int y, uint32_t col) //WLEDMM: } #if 0 // this is a dangerous optimization - if ((i < UINT_MAX) && sameColor && (call > 0) && (!transitional) && (ledsrgb[i] == CRGB(col)) && (_globalLeds == nullptr)) return; // WLEDMM looks like nothing to do (but we don't trust globalleds) + if ((i < UINT_MAX) && sameColor && (call > 0) && (!transitional) && (ledsrgb[i] == CRGB(col))) return; // WLEDMM looks like nothing to do #endif if (reverse ) x = cols - x - 1; @@ -684,7 +684,7 @@ void Segment::drawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint3 if (x0 >= cols || x1 >= cols || y0 >= rows || y1 >= rows) return; // WLEDMM shortcut when no grouping/spacing used - bool simpleSegment = !reverse && (grouping == 1) && (spacing == 0); // !reverse is just for back-to-back testing against "slow" functions + bool simpleSegment = (grouping == 1) && (spacing == 0); uint32_t scaled_col = c; if (simpleSegment) { // segment brightness must be pre-calculated for the "fast" setPixelColorXY variant! diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 78bae5f4..11a5e0ea 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -1005,7 +1005,7 @@ void IRAM_ATTR_YN Segment::setPixelColor(int i, uint32_t col) //WLEDMM: IRAM_ATT break; case M12_sPinwheel: { // WLEDMM shortcut when no grouping/spacing used - bool simpleSegment = !reverse && (grouping == 1) && (spacing == 0); // !reverse is just for back-to-back testing against "slow" functions + bool simpleSegment = (grouping == 1) && (spacing == 0); uint32_t scaled_col = col; if (simpleSegment) { // segment brightness must be pre-calculated for the "fast" setPixelColorXY variant! @@ -1339,7 +1339,7 @@ void Segment::fill(uint32_t c) { if (is2D()) { // pre-calculate scaled color uint32_t scaled_col = c; - bool simpleSegment = !reverse && (grouping == 1) && (spacing == 0); // !reverse is just for back-to-back testing against "slow" functions + bool simpleSegment = (grouping == 1) && (spacing == 0); if (simpleSegment) { uint8_t _bri_t = currentBri(on ? opacity : 0); if (!_bri_t && !transitional) return;