kopia lustrzana https://github.com/OpenRTX/OpenRTX
gfx_print: use global buffer instead of allocating it to the stack
rodzic
341ab84ce9
commit
0e33848d68
|
@ -95,6 +95,7 @@ bw_t _color2bw(color_t true_color)
|
||||||
bool initialized = 0;
|
bool initialized = 0;
|
||||||
PIXEL_T *buf;
|
PIXEL_T *buf;
|
||||||
uint16_t fbSize;
|
uint16_t fbSize;
|
||||||
|
char text[32];
|
||||||
|
|
||||||
void gfx_init()
|
void gfx_init()
|
||||||
{
|
{
|
||||||
|
@ -111,6 +112,8 @@ void gfx_init()
|
||||||
if((fbSize * 8) < (SCREEN_HEIGHT * SCREEN_WIDTH)) fbSize += 1;
|
if((fbSize * 8) < (SCREEN_HEIGHT * SCREEN_WIDTH)) fbSize += 1;
|
||||||
fbSize *= sizeof(uint8_t);
|
fbSize *= sizeof(uint8_t);
|
||||||
#endif
|
#endif
|
||||||
|
// Clear text buffer
|
||||||
|
memset(text, 0x00, 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gfx_terminate()
|
void gfx_terminate()
|
||||||
|
@ -387,8 +390,6 @@ point_t gfx_print(point_t start, fontSize_t size, textAlign_t alignment,
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
char text[128];
|
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(text, sizeof(text)-1, fmt, ap);
|
vsnprintf(text, sizeof(text)-1, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
Ładowanie…
Reference in New Issue