From b47c55db90e6c39fbbf103c51d64e0989c901200 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 18 Aug 2024 13:21:55 +0200 Subject: [PATCH] fix 8266 builds wled00/FX_fcn.cpp:974:16: error: '_isSuperSimpleSegment' was not declared in this scope --- wled00/FX.h | 4 ++-- wled00/FX_2Dfcn.cpp | 5 +++-- wled00/FX_fcn.cpp | 15 +++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/wled00/FX.h b/wled00/FX.h index 546e8b98..17e70021 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -436,10 +436,10 @@ typedef struct Segment { static size_t _usedSegmentData; // WLEDMM uint16_t is too small void setPixelColorXY_fast(int x, int y,uint32_t c, uint32_t scaled_col, int cols, int rows); // set relative pixel within segment with color - faster, but no error checking!!! + bool _isSimpleSegment = false; // simple = no grouping or spacing - mirror, transpose or reverse allowed + bool _isSuperSimpleSegment = false; // superSimple = no grouping or spacing, no mirror - only transpose or reverse allowed #ifdef WLEDMM_FASTPATH // WLEDMM cache some values that won't change while drawing a frame - bool _isSimpleSegment = false; - bool _isSuperSimpleSegment = false; bool _isValid2D = false; uint8_t _brightness = 255; // final pixel brightness - including transitions and segment opacity bool _firstFill = true; // dirty HACK support diff --git a/wled00/FX_2Dfcn.cpp b/wled00/FX_2Dfcn.cpp index bb0b1861..4518bdff 100644 --- a/wled00/FX_2Dfcn.cpp +++ b/wled00/FX_2Dfcn.cpp @@ -237,11 +237,12 @@ uint32_t __attribute__((hot)) WS2812FX::getPixelColorXY(uint16_t x, uint16_t y) // WLEDMM cache some values so we don't need to re-calc then for each pixel void Segment::startFrame(void) { + _isSimpleSegment = (grouping == 1) && (spacing == 0); // we can handle pixels faster when no grouping or spacing is involved + _isSuperSimpleSegment = !mirror && !mirror_y && (grouping == 1) && (spacing == 0); // fastest - we only draw one pixel per call + #ifdef WLEDMM_FASTPATH _isValid2D = isActive() && is2D(); _brightness = currentBri(on ? opacity : 0); - _isSimpleSegment = (grouping == 1) && (spacing == 0); // we can handle pixels faster when no grouping or spacing is involved - _isSuperSimpleSegment = !mirror && !mirror_y && (grouping == 1) && (spacing == 0); // fastest - we only draw one pixel per call // if (reverse_y) _isSimpleSegment = false; // for A/B testing _2dWidth = is2D() ? calc_virtualWidth() : virtualLength(); _2dHeight = calc_virtualHeight(); diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index f8f2269e..c4b1a459 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -102,12 +102,11 @@ Segment::Segment(const Segment &orig) { DEBUG_PRINTLN(F("-- Copy segment constructor --")); memcpy((void*)this, (void*)&orig, sizeof(Segment)); //WLEDMM copy to this transitional = false; // copied segment cannot be in transition -#ifdef WLEDMM_FASTPATH // WLEDMM temporarily prevent any fast draw calls to the new segment // _isValid2D = false; _isSimpleSegment = false; _isSuperSimpleSegment = false; -#endif + name = nullptr; data = nullptr; _dataLen = 0; @@ -149,11 +148,11 @@ void Segment::allocLeds() { // move constructor --> moves everything (including buffer) from orig to this Segment::Segment(Segment &&orig) noexcept { DEBUG_PRINTLN(F("-- Move segment constructor --")); -#ifdef WLEDMM_FASTPATH + // WLEDMM temporarily prevent any fast draw calls to old and new segment orig._isSimpleSegment = false; orig._isSuperSimpleSegment = false; -#endif + memcpy((void*)this, (void*)&orig, sizeof(Segment)); orig.transitional = false; // old segment cannot be in transition any more #ifdef WLEDMM_FASTPATH @@ -184,12 +183,12 @@ Segment& Segment::operator= (const Segment &orig) { // copy source memcpy((void*)this, (void*)&orig, sizeof(Segment)); transitional = false; -#ifdef WLEDMM_FASTPATH + // WLEDMM prevent any fast draw calls to this segment until the next frame starts //_isValid2D = false; _isSimpleSegment = false; _isSuperSimpleSegment = false; -#endif + // erase pointers to allocated data name = nullptr; data = nullptr; @@ -217,11 +216,11 @@ Segment& Segment::operator= (Segment &&orig) noexcept { deallocateData(); // free old runtime data if (_t) { delete _t; _t = nullptr; } if (ledsrgb && !Segment::_globalLeds) free(ledsrgb); //WLEDMM: not needed anymore as we will use leds from copy. no need to nullify ledsrgb as it gets new value in memcpy -#ifdef WLEDMM_FASTPATH + // WLEDMM temporarily prevent any fast draw calls to old and new segment orig._isSimpleSegment = false; orig._isSuperSimpleSegment = false; -#endif + memcpy((void*)this, (void*)&orig, sizeof(Segment)); #ifdef WLEDMM_FASTPATH // WLEDMM temporarily prevent any draw calls to old segment