drawCharacter minor speedup

This commit is contained in:
Frank
2024-10-23 14:23:54 +02:00
parent 4aa9c2607d
commit 922c5e74df

View File

@@ -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