mirror of https://github.com/MLXXXp/Arduboy2.git
optimize drawChar (-126 bytes)
This commit is contained in:
parent
6e13fc019f
commit
ae8e284d41
|
@ -1159,7 +1159,9 @@ size_t Arduboy2::write(uint8_t c)
|
|||
void Arduboy2::drawChar
|
||||
(int16_t x, int16_t y, unsigned char c, uint8_t color, uint8_t bg, uint8_t size)
|
||||
{
|
||||
uint8_t line;
|
||||
bool draw_background = bg != color;
|
||||
uint8_t *bitmap = font + c*5;
|
||||
|
||||
if ((x >= WIDTH) || // Clip right
|
||||
(y >= HEIGHT) || // Clip bottom
|
||||
|
@ -1170,17 +1172,12 @@ void Arduboy2::drawChar
|
|||
return;
|
||||
}
|
||||
|
||||
for (int8_t i=0; i<6; i++ )
|
||||
{
|
||||
uint8_t line;
|
||||
if (i == 5)
|
||||
for (uint8_t i=0; i<6; i++ )
|
||||
{
|
||||
line = pgm_read_byte(bitmap++);
|
||||
if (i == 5) {
|
||||
line = 0x0;
|
||||
}
|
||||
else
|
||||
{
|
||||
line = pgm_read_byte(font+(c*5)+i);
|
||||
}
|
||||
|
||||
for (int8_t j = 0; j<8; j++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue