From bb8223d4ffc741ce103c0382e9963d68d12d1971 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Wed, 2 Aug 2023 22:01:15 +0200 Subject: [PATCH] Soap bugfix. --- wled00/FX.cpp | 9 +++++---- wled00/wled.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 7ddd9988..834c17e9 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -7419,6 +7419,7 @@ uint16_t mode_2Dsoap() { int amplitude; int8_t shiftX = 0; //(SEGMENT.custom1 - 128) / 4; int8_t shiftY = 0; //(SEGMENT.custom2 - 128) / 4; + CRGB ledsbuff[MAX(cols,rows)]; amplitude = (cols >= 16) ? (cols-8)/8 : 1; for (int y = 0; y < rows; y++) { @@ -7439,9 +7440,9 @@ uint16_t mode_2Dsoap() { CRGB PixelB = CRGB::Black; if ((zF >= 0) && (zF < cols)) PixelB = SEGMENT.getPixelColorXY(zF, y); else PixelB = ColorFromPalette(SEGPALETTE, ~noise3d[XY(abs(zF),y)]*3); - CRGB pix = (PixelA.nscale8(ease8InOutApprox(255 - fraction))) + (PixelB.nscale8(ease8InOutApprox(fraction))); - SEGMENT.setPixelColorXY(x, y, pix); + ledsbuff[x] = (PixelA.nscale8(ease8InOutApprox(255 - fraction))) + (PixelB.nscale8(ease8InOutApprox(fraction))); } + for (int x = 0; x < cols; x++) SEGMENT.setPixelColorXY(x, y, ledsbuff[x]); } amplitude = (rows >= 16) ? (rows-8)/8 : 1; @@ -7463,9 +7464,9 @@ uint16_t mode_2Dsoap() { CRGB PixelB = CRGB::Black; if ((zF >= 0) && (zF < rows)) PixelB = SEGMENT.getPixelColorXY(x, zF); else PixelB = ColorFromPalette(SEGPALETTE, ~noise3d[XY(x,abs(zF))]*3); - CRGB pix = (PixelA.nscale8(ease8InOutApprox(255 - fraction))) + (PixelB.nscale8(ease8InOutApprox(fraction))); - SEGMENT.setPixelColorXY(x, y, pix); + ledsbuff[y] = (PixelA.nscale8(ease8InOutApprox(255 - fraction))) + (PixelB.nscale8(ease8InOutApprox(fraction))); } + for (int y = 0; y < rows; y++) SEGMENT.setPixelColorXY(x, y, ledsbuff[y]); } return FRAMETIME; diff --git a/wled00/wled.h b/wled00/wled.h index e2cbf93d..696b957e 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2307180 +#define VERSION 2308020 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG