mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-07-30 02:37:33 +02:00
Avoid warnings if fonts disabled in setup
This commit is contained in:
@ -2076,15 +2076,16 @@ void TFT_eSprite::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uin
|
||||
|
||||
uint8_t w = pgm_read_byte(&glyph->width),
|
||||
h = pgm_read_byte(&glyph->height);
|
||||
int8_t xo = pgm_read_byte(&glyph->xOffset),
|
||||
yo = pgm_read_byte(&glyph->yOffset);
|
||||
|
||||
if (((x + w * size - 1) < (_vpX - _xDatum)) || // Clip left
|
||||
((y + h * size - 1) < (_vpY - _yDatum))) // Clip top
|
||||
if (((x + xo + w * size - 1) < (_vpX - _xDatum)) || // Clip left
|
||||
((y + yo + h * size - 1) < (_vpY - _yDatum))) // Clip top
|
||||
return;
|
||||
|
||||
uint8_t *bitmap = (uint8_t *)pgm_read_dword(&gfxFont->bitmap);
|
||||
uint32_t bo = pgm_read_word(&glyph->bitmapOffset);
|
||||
int8_t xo = pgm_read_byte(&glyph->xOffset),
|
||||
yo = pgm_read_byte(&glyph->yOffset);
|
||||
|
||||
uint8_t xx, yy, bits=0, bit=0;
|
||||
//uint8_t xa = pgm_read_byte(&glyph->xAdvance);
|
||||
int16_t xo16 = 0, yo16 = 0;
|
||||
@ -2126,6 +2127,12 @@ void TFT_eSprite::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uin
|
||||
#ifdef LOAD_GFXFF
|
||||
} // End classic vs custom font
|
||||
#endif
|
||||
#else
|
||||
#ifndef LOAD_GFXFF
|
||||
color = color;
|
||||
bg = bg;
|
||||
size = size;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
@ -2385,6 +2392,17 @@ int16_t TFT_eSprite::drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t fo
|
||||
}
|
||||
// End of RLE font rendering
|
||||
#endif
|
||||
|
||||
#if !defined (LOAD_FONT2) && !defined (LOAD_RLE)
|
||||
// Stop warnings
|
||||
flash_address = flash_address;
|
||||
w = w;
|
||||
pX = pX;
|
||||
pY = pY;
|
||||
line = line;
|
||||
clip = clip;
|
||||
#endif
|
||||
|
||||
return width * textsize; // x +
|
||||
}
|
||||
|
||||
|
28
TFT_eSPI.cpp
28
TFT_eSPI.cpp
@ -473,7 +473,7 @@ TFT_eSPI::TFT_eSPI(int16_t w, int16_t h)
|
||||
_cp437 = true; // Legacy GLCD font bug fix
|
||||
_utf8 = true; // UTF8 decoding enabled
|
||||
|
||||
#ifdef FONT_FS_AVAILABLE
|
||||
#if defined (FONT_FS_AVAILABLE) && defined (SMOOTH_FONT)
|
||||
fs_font = true; // Smooth font filing system or array (fs_font = false) flag
|
||||
#endif
|
||||
|
||||
@ -3016,9 +3016,6 @@ void TFT_eSPI::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32
|
||||
{
|
||||
if (_vpOoB) return;
|
||||
|
||||
int32_t xd = x + _xDatum;
|
||||
int32_t yd = y + _yDatum;
|
||||
|
||||
if (c < 32) return;
|
||||
#ifdef LOAD_GLCD
|
||||
//>>>>>>>>>>>>>>>>>>
|
||||
@ -3027,6 +3024,9 @@ void TFT_eSPI::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32
|
||||
#endif
|
||||
//>>>>>>>>>>>>>>>>>>
|
||||
|
||||
int32_t xd = x + _xDatum;
|
||||
int32_t yd = y + _yDatum;
|
||||
|
||||
if ((xd >= _vpW) || // Clip right
|
||||
( yd >= _vpH) || // Clip bottom
|
||||
((xd + 6 * size - 1) < _vpX) || // Clip left
|
||||
@ -3153,6 +3153,15 @@ void TFT_eSPI::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uint32
|
||||
#ifdef LOAD_GFXFF
|
||||
} // End classic vs custom font
|
||||
#endif
|
||||
#else
|
||||
#ifndef LOAD_GFXFF
|
||||
// Avoid warnings if fonts are disabled
|
||||
x = x;
|
||||
y = y;
|
||||
color = color;
|
||||
bg = bg;
|
||||
size = size;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
@ -4863,6 +4872,17 @@ int16_t TFT_eSPI::drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t font)
|
||||
}
|
||||
// End of RLE font rendering
|
||||
#endif
|
||||
|
||||
#if !defined (LOAD_FONT2) && !defined (LOAD_RLE)
|
||||
// Stop warnings
|
||||
flash_address = flash_address;
|
||||
w = w;
|
||||
pX = pX;
|
||||
pY = pY;
|
||||
line = line;
|
||||
clip = clip;
|
||||
#endif
|
||||
|
||||
return width * textsize; // x +
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user