bugfix #2 for switched-off segments
segments that are "off" were still rendered during transitions.
This commit is contained in:
@@ -380,6 +380,7 @@ typedef struct Segment {
|
||||
};
|
||||
uint8_t grouping, spacing;
|
||||
uint8_t opacity;
|
||||
uint8_t lastBri; // WLEDMM optimization for black-to-black "transitions"
|
||||
bool needsBlank; // WLEDMM indicates that Segment needs to be blanked (due to change of mirror / reverse / transpose / spacing)
|
||||
uint32_t colors[NUM_COLORS];
|
||||
uint8_t cct; //0==1900K, 255==10091K
|
||||
@@ -490,6 +491,7 @@ typedef struct Segment {
|
||||
grouping(1),
|
||||
spacing(0),
|
||||
opacity(255),
|
||||
lastBri(255),
|
||||
needsBlank(false),
|
||||
colors{DEFAULT_COLOR,BLACK,BLACK},
|
||||
cct(127),
|
||||
|
||||
@@ -1935,6 +1935,7 @@ void WS2812FX::service() {
|
||||
now = millis() + timebase;
|
||||
#endif
|
||||
seg.startFrame(); // WLEDMM
|
||||
if (!_triggered && (seg.currentBri(seg.opacity) == 0) && (seg.lastBri == 0)) continue; // WLEDMM skip totally black segments
|
||||
// effect blending (execute previous effect)
|
||||
// actual code may be a bit more involved as effects have runtime data including allocated memory
|
||||
//if (seg.transitional && seg._modeP) (*_mode[seg._modeP])(progress());
|
||||
@@ -1944,6 +1945,7 @@ void WS2812FX::service() {
|
||||
if (seg.mode != FX_MODE_HALLOWEEN_EYES) seg.call++;
|
||||
if (seg.transitional && frameDelay > FRAMETIME) frameDelay = FRAMETIME; // force faster updates during transition
|
||||
|
||||
seg.lastBri = seg.currentBri(seg.on ? seg.opacity:0); // WLEDMM remember for next time
|
||||
seg.handleTransition();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user