mirror of
https://github.com/wled/WLED.git
synced 2026-03-13 08:29:49 +08:00
bugfix #5295 - change remaining references to strip.paletteBlend into paletteBlend
these were leftover after refactoring paletteBlend into a global variable. see #5295 for details
This commit is contained in:
@@ -40,7 +40,7 @@ static pixels::RollEvent GetLastRollForSegment() {
|
||||
* Alternating pixels running function (copied static function).
|
||||
*/
|
||||
// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (undefined)
|
||||
#define PALETTE_SOLID_WRAP (strip.paletteBlend == 1 || strip.paletteBlend == 3)
|
||||
#define PALETTE_SOLID_WRAP (paletteBlend == 1 || paletteBlend == 3)
|
||||
static void running_copy(uint32_t color1, uint32_t color2, bool theatre = false) {
|
||||
int width = (theatre ? 3 : 1) + (SEGMENT.intensity >> 4); // window
|
||||
uint32_t cycleTime = 50 + (255 - SEGMENT.speed);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// for information how FX metadata strings work see https://kno.wled.ge/interfaces/json-api/#effect-metadata
|
||||
|
||||
// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (undefined)
|
||||
#define PALETTE_SOLID_WRAP (strip.paletteBlend == 1 || strip.paletteBlend == 3)
|
||||
#define PALETTE_SOLID_WRAP (paletteBlend == 1 || paletteBlend == 3)
|
||||
|
||||
#define indexToVStrip(index, stripNr) ((index) | (int((stripNr)+1)<<16))
|
||||
|
||||
@@ -874,7 +874,7 @@ static void handleBoundary(Ant& ant, float& position, bool gatherFood, bool atSt
|
||||
// Helper function to calculate ant color
|
||||
static uint32_t getAntColor(int antIndex, int numAnts, bool usePalette) {
|
||||
if (usePalette)
|
||||
return SEGMENT.color_from_palette(antIndex * 255 / numAnts, false, (strip.paletteBlend == 1 || strip.paletteBlend == 3), 255);
|
||||
return SEGMENT.color_from_palette(antIndex * 255 / numAnts, false, (paletteBlend == 1 || paletteBlend == 3), 255);
|
||||
// Alternate between two colors for default palette
|
||||
return (antIndex % 3 == 1) ? SEGCOLOR(0) : SEGCOLOR(2);
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
|
||||
#define IBN 5100
|
||||
// paletteBlend: 0 - wrap when moving, 1 - always wrap, 2 - never wrap, 3 - none (undefined)
|
||||
#define PALETTE_SOLID_WRAP (strip.paletteBlend == 1 || strip.paletteBlend == 3)
|
||||
#define PALETTE_MOVING_WRAP !(strip.paletteBlend == 2 || (strip.paletteBlend == 0 && SEGMENT.speed == 0))
|
||||
#define PALETTE_SOLID_WRAP (paletteBlend == 1 || paletteBlend == 3)
|
||||
#define PALETTE_MOVING_WRAP !(paletteBlend == 2 || (paletteBlend == 0 && SEGMENT.speed == 0))
|
||||
|
||||
#define indexToVStrip(index, stripNr) ((index) | (int((stripNr)+1)<<16))
|
||||
|
||||
@@ -3398,7 +3398,7 @@ void mode_glitter()
|
||||
counter = counter >> 8;
|
||||
}
|
||||
|
||||
bool noWrap = (strip.paletteBlend == 2 || (strip.paletteBlend == 0 && SEGMENT.speed == 0));
|
||||
bool noWrap = (paletteBlend == 2 || (paletteBlend == 0 && SEGMENT.speed == 0));
|
||||
for (unsigned i = 0; i < SEGLEN; i++) {
|
||||
unsigned colorIndex = (i * 255 / SEGLEN) - counter;
|
||||
if (noWrap) colorIndex = map(colorIndex, 0, 255, 0, 240); //cut off blend at palette "end"
|
||||
|
||||
@@ -834,7 +834,6 @@ class WS2812FX {
|
||||
public:
|
||||
|
||||
WS2812FX() :
|
||||
paletteBlend(0),
|
||||
now(millis()),
|
||||
timebase(0),
|
||||
isMatrix(false),
|
||||
@@ -936,7 +935,7 @@ class WS2812FX {
|
||||
inline bool isSuspended() const { return _suspend; } // returns true if strip.service() execution is suspended
|
||||
inline bool needsUpdate() const { return _triggered; } // returns true if strip received a trigger() request
|
||||
|
||||
uint8_t paletteBlend;
|
||||
// uint8_t paletteBlend; // obsolete - use global paletteBlend instead of strip.paletteBlend
|
||||
uint8_t getActiveSegmentsNum() const;
|
||||
uint8_t getFirstSelectedSegId() const;
|
||||
uint8_t getLastActiveSegmentId() const;
|
||||
|
||||
Reference in New Issue
Block a user