post-merge

* add missing "cool" option in twinklefox
* upstream compatibility defines for gamma32inv() and gamma8inv()
This commit is contained in:
Frank
2025-12-16 01:11:40 +01:00
parent 1e57262171
commit 462e4cb805
2 changed files with 8 additions and 11 deletions

View File

@@ -2768,13 +2768,7 @@ static const char _data_FX_MODE_RIPPLE_RAINBOW[] PROGMEM = "Ripple Rainbow@!,Wav
// //
// TwinkleFOX: Twinkling 'holiday' lights that fade in and out. // TwinkleFOX: Twinkling 'holiday' lights that fade in and out.
// Colors are chosen from a palette. Read more about this effect using the link above! // Colors are chosen from a palette. Read more about this effect using the link above!
static CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
// If COOL_LIKE_INCANDESCENT is set to 1, colors will
// fade out slighted 'reddened', similar to how
// incandescent bulbs change color as they get dim down.
#define COOL_LIKE_INCANDESCENT 1
CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
{ {
// Overall twinkle speed (changed) // Overall twinkle speed (changed)
uint16_t ticks = ms / SEGENV.aux0; uint16_t ticks = ms / SEGENV.aux0;
@@ -2814,7 +2808,7 @@ CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
CRGB c; CRGB c;
if (bright > 0) { if (bright > 0) {
c = ColorFromPalette(SEGPALETTE, hue, bright, NOBLEND); c = ColorFromPalette(SEGPALETTE, hue, bright, NOBLEND);
if(COOL_LIKE_INCANDESCENT == 1) { if (!SEGMENT.check1) {
// This code takes a pixel, and if its in the 'fading down' // This code takes a pixel, and if its in the 'fading down'
// part of the cycle, it adjusts the color a little bit like the // part of the cycle, it adjusts the color a little bit like the
// way that incandescent bulbs fade toward 'red' as they dim. // way that incandescent bulbs fade toward 'red' as they dim.
@@ -2836,7 +2830,7 @@ CRGB twinklefox_one_twinkle(uint32_t ms, uint8_t salt, bool cat)
// "CalculateOneTwinkle" on each pixel. It then displays // "CalculateOneTwinkle" on each pixel. It then displays
// either the twinkle color of the background color, // either the twinkle color of the background color,
// whichever is brighter. // whichever is brighter.
uint16_t twinklefox_base(bool cat) static uint16_t twinklefox_base(bool cat)
{ {
// "PRNG16" is the pseudorandom number generator // "PRNG16" is the pseudorandom number generator
// It MUST be reset to the same starting value each time // It MUST be reset to the same starting value each time
@@ -2889,7 +2883,7 @@ uint16_t twinklefox_base(bool cat)
} else { } else {
// if the new pixel is not at all brighter than the background color, // if the new pixel is not at all brighter than the background color,
// just use the background color. // just use the background color.
SEGMENT.setPixelColor(i, bg.r, bg.g, bg.b); SEGMENT.setPixelColor(i, bg);
} }
} }
return FRAMETIME; return FRAMETIME;
@@ -2900,7 +2894,7 @@ uint16_t mode_twinklefox()
{ {
return twinklefox_base(false); return twinklefox_base(false);
} }
static const char _data_FX_MODE_TWINKLEFOX[] PROGMEM = "Twinklefox@!,Twinkle rate;!,!;!"; static const char _data_FX_MODE_TWINKLEFOX[] PROGMEM = "Twinklefox@!,Twinkle rate,,,,Cool;!,!;!";
uint16_t mode_twinklecat() uint16_t mode_twinklecat()

View File

@@ -89,6 +89,9 @@ extern uint8_t gammaT[256]; // colors.cpp
inline uint8_t gamma8(uint8_t value) { return gammaT[value];} // WLEDMM inlined for speed inline uint8_t gamma8(uint8_t value) { return gammaT[value];} // WLEDMM inlined for speed
inline uint8_t fast_unGamma8(uint8_t value) { return gammaTinv[value];} inline uint8_t fast_unGamma8(uint8_t value) { return gammaTinv[value];}
#define gamma32inv(c) unGamma24(c) // WLEDMM alias for upstream compatibility
#define gamma8inv(c) fast_unGamma8(c) // WLEDMM alias for upstream compatibility
//dmx_output.cpp //dmx_output.cpp
void initDMXOutput(); void initDMXOutput();
void handleDMXOutput(); void handleDMXOutput();