From 2faf84d78bf261b6f02648e66f0c84efc1eefd05 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 8 Jun 2021 14:34:13 +0200 Subject: Change draw_tile to allow coloring of flat tiles --- src/text/text.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/text') diff --git a/src/text/text.h b/src/text/text.h index 01dddb0..931227c 100644 --- a/src/text/text.h +++ b/src/text/text.h @@ -109,12 +109,12 @@ txt_position(size_t tile_x, size_t tile_y) { // color merging issues. static inline void -txt_draws(char *msg, size_t x, size_t y, size_t spacing) { +txt_draws(char *msg, size_t x, size_t y, size_t spacing, u8 clr) { while (*msg) { char c = *msg++; Tile *tile = FONT_DATA; tile += c; - draw_tile(x, y, tile, true); + draw_tile(x, y, tile, clr, true); x += spacing; } } @@ -129,11 +129,11 @@ txt_draws(char *msg, size_t x, size_t y, size_t spacing) { // Draws text to the screen with formatting starting on the x and y position and // with custom character spacing. -#define txt_drawf(msg, x, y, s, ...) \ +#define txt_drawf(msg, x, y, s, c, ...) \ { \ char buf[256] = {0}; \ posprintf(buf, msg, ##__VA_ARGS__); \ - txt_draws(buf, x, y, s); \ + txt_draws(buf, x, y, s, c); \ } #endif // TEXT_H -- cgit v1.2.1