Skip to content

Commit f2f621b

Browse files
committed
minor FX improvements
Fire2012: better randomness Julia: avoid darkening when using "blur"
1 parent 796eb6e commit f2f621b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wled00/FX.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,12 +2128,16 @@ uint16_t mode_fire_2012() {
21282128

21292129
const uint8_t ignition = max(3,SEGLEN/10); // ignition area: 10% of segment length or minimum 3 pixels
21302130

2131+
#if defined(ARDUINO_ARCH_ESP32)
2132+
random16_add_entropy(esp_random() & 0xFFFF); // improves randonmess
2133+
#endif
2134+
21312135
// Step 1. Cool down every cell a little
21322136
for (int i = 0; i < SEGLEN; i++) {
21332137
uint8_t cool = (it != SEGENV.step) ? random8((((20 + SEGMENT.speed/3) * 16) / SEGLEN)+2) : random8(4);
21342138
uint8_t minTemp = (i<ignition) ? (ignition-i)/4 + 16 : 0; // should not become black in ignition area
21352139
uint8_t temp = qsub8(heat[i], cool);
2136-
heat[i] = temp<minTemp ? minTemp : temp;
2140+
heat[i] = max(minTemp, temp);
21372141
}
21382142

21392143
if (it != SEGENV.step) {
@@ -5706,6 +5710,7 @@ uint16_t mode_2DJulia(void) { // An animated Julia set
57065710
float imAg;
57075711

57085712
if (SEGENV.call == 0) { // Reset the center if we've just re-started this animation.
5713+
SEGMENT.setUpLeds(); SEGMENT.fill(BLACK); // WLEDMM avoids dimming when blur option is selected
57095714
julias->xcen = 0.;
57105715
julias->ycen = 0.;
57115716
julias->xymag = 1.0;

0 commit comments

Comments
 (0)