drawCharacter minor speedup
This commit is contained in:
@@ -942,11 +942,13 @@ void Segment::drawCharacter(unsigned char chr, int16_t x, int16_t y, uint8_t w,
|
||||
default: return;
|
||||
}
|
||||
if (col2 != BLACK) col = ColorFromPalette(grad, (i+1)*255/h, 255, NOBLEND);
|
||||
uint32_t fgCol = uint32_t(col) & 0x00FFFFFF; // WLEDMM cache color value
|
||||
|
||||
for (int j = 0; j<w; j++) { // character width
|
||||
int16_t x0 = x + (w-1) - j;
|
||||
if ((x0 >= 0) || (x0 < cols)) {
|
||||
if ((bits>>(j+(8-w))) & 0x01) { // bit set & drawing on-screen
|
||||
setPixelColorXY(x0, y0, col);
|
||||
setPixelColorXY(x0, y0, fgCol);
|
||||
} else {
|
||||
if (drawShadow) {
|
||||
// WLEDMM
|
||||
|
||||
Reference in New Issue
Block a user