From 9500f7badf144a0abc8e658a8af59e43505a513c Mon Sep 17 00:00:00 2001 From: Brandon502 <105077712+Brandon502@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:04:51 -0400 Subject: [PATCH] Snow Fall - Drawing change Fixes snow disappearing due to auto brightness limiter (?) by redrawing stuck snow. --- wled00/FX.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index d0dcc920..2f79662e 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -5451,15 +5451,12 @@ uint16_t mode_2DSnowFall(void) { // By: Brandon Butler else if (x % 2 == 0 && downRight && !getBitValue(grid, pos + 1)) newX = x + 1; // Even Columns Move Right } - if (newY == y && newX == x) continue; // Snow didn't move. Don't update grid or pixels - - setBitValue(grid, pos, 0); // Clear old - setBitValue(grid, XY(newX, newY), 1); // Set new - - if (overlay) continue; // Skip drawing if inverted overlay - - SEGMENT.setPixelColorXY(newX, newY, xyColor); // Draw new - SEGMENT.setPixelColorXY(x, y, color_blend(xyColor, bgColor, blur)); // Fade old + if (newY != y || newX != x) { // Snow moved + setBitValue(grid, pos, 0); // Clear old + setBitValue(grid, XY(newX, newY), 1); // Set new + if (!overlay) SEGMENT.setPixelColorXY(x, y, color_blend(xyColor, bgColor, blur)); // Fade old + } + if (!overlay) SEGMENT.setPixelColorXY(newX, newY, xyColor); // Draw new / redraw stuck } }