minor corrections
* fix some override problems bus_manager (canShow() must not be const!!!) * fixing some "comparing integer with different signedness" warnings
This commit is contained in:
@@ -1413,12 +1413,12 @@ void __attribute__((hot)) Segment::fill(uint32_t c) {
|
||||
if (_bri_t < 255) scaled_col = color_fade(c, _bri_t);
|
||||
}
|
||||
// fill 2D segment
|
||||
for(int y = 0; y < rows; y++) for (int x = 0; x < cols; x++) {
|
||||
for(unsigned y = 0; y < rows; y++) for (unsigned x = 0; x < cols; x++) {
|
||||
if (simpleSegment) setPixelColorXY_fast(x, y, c, scaled_col, cols, rows);
|
||||
else setPixelColorXY_slow(x, y, c);
|
||||
}
|
||||
} else { // fill 1D strip
|
||||
for (int x = 0; x < cols; x++) setPixelColor(x, c);
|
||||
for (unsigned x = 0; x < cols; x++) setPixelColor(int(x), c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1471,8 +1471,8 @@ void __attribute__((hot)) Segment::fade_out(uint8_t rate) {
|
||||
int g2 = G(color2);
|
||||
int b2 = B(color2);
|
||||
|
||||
for (int y = 0; y < rows; y++) for (int x = 0; x < cols; x++) {
|
||||
uint32_t color = is2D() ? getPixelColorXY(x, y) : getPixelColor(x);
|
||||
for (unsigned y = 0; y < rows; y++) for (unsigned x = 0; x < cols; x++) {
|
||||
uint32_t color = is2D() ? getPixelColorXY(int(x), int(y)) : getPixelColor(int(x));
|
||||
if (color == color2) continue; // WLEDMM speedup - pixel color = target color, so nothing to do
|
||||
int w1 = W(color);
|
||||
int r1 = R(color);
|
||||
@@ -1492,8 +1492,8 @@ void __attribute__((hot)) Segment::fade_out(uint8_t rate) {
|
||||
uint32_t colorNew = RGBW32(r1 + rdelta, g1 + gdelta, b1 + bdelta, w1 + wdelta); // WLEDMM
|
||||
|
||||
if (colorNew != color) { // WLEDMM speedup - do not repaint the same color
|
||||
if (is2D()) setPixelColorXY(x, y, colorNew);
|
||||
else setPixelColor(x, colorNew);
|
||||
if (is2D()) setPixelColorXY(int(x), int(y), colorNew);
|
||||
else setPixelColor(int(x), colorNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1507,11 +1507,11 @@ void __attribute__((hot)) Segment::fadeToBlackBy(uint8_t fadeBy) {
|
||||
|
||||
// WLEDMM minor optimization
|
||||
if(is2D()) {
|
||||
for (int y = 0; y < rows; y++) for (int x = 0; x < cols; x++) {
|
||||
uint32_t cc = getPixelColorXY(x,y); // WLEDMM avoid RGBW32 -> CRGB -> RGBW32 conversion
|
||||
for (unsigned y = 0; y < rows; y++) for (unsigned x = 0; x < cols; x++) {
|
||||
uint32_t cc = getPixelColorXY(int(x),int(y)); // WLEDMM avoid RGBW32 -> CRGB -> RGBW32 conversion
|
||||
uint32_t cc2 = color_fade(cc, scaledown); // fade
|
||||
//if (cc2 != cc) // WLEDMM only re-paint if faded color is different - disabled - causes problem with text overlay
|
||||
setPixelColorXY((uint16_t)x, (uint16_t)y, cc2);
|
||||
setPixelColorXY(int(x), int(y), cc2);
|
||||
}
|
||||
} else {
|
||||
for (uint_fast16_t x = 0; x < cols; x++) {
|
||||
|
||||
Reference in New Issue
Block a user