aboutsummaryrefslogtreecommitdiffstats
path: root/src/text
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-06-08 14:34:13 +0200
committerBad Diode <bd@badd10de.dev>2021-06-08 14:34:13 +0200
commit2faf84d78bf261b6f02648e66f0c84efc1eefd05 (patch)
tree3f780b2835eaa8505ebc87769b252fa9d639fe03 /src/text
parent436b4a1d28f5939e1c0f8792317a639b091b0f29 (diff)
downloadstepper-2faf84d78bf261b6f02648e66f0c84efc1eefd05.tar.gz
stepper-2faf84d78bf261b6f02648e66f0c84efc1eefd05.zip
Change draw_tile to allow coloring of flat tiles
Diffstat (limited to 'src/text')
-rw-r--r--src/text/text.h8
1 files changed, 4 insertions, 4 deletions
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) {
109// color merging issues. 109// color merging issues.
110static inline 110static inline
111void 111void
112txt_draws(char *msg, size_t x, size_t y, size_t spacing) { 112txt_draws(char *msg, size_t x, size_t y, size_t spacing, u8 clr) {
113 while (*msg) { 113 while (*msg) {
114 char c = *msg++; 114 char c = *msg++;
115 Tile *tile = FONT_DATA; 115 Tile *tile = FONT_DATA;
116 tile += c; 116 tile += c;
117 draw_tile(x, y, tile, true); 117 draw_tile(x, y, tile, clr, true);
118 x += spacing; 118 x += spacing;
119 } 119 }
120} 120}
@@ -129,11 +129,11 @@ txt_draws(char *msg, size_t x, size_t y, size_t spacing) {
129 129
130// Draws text to the screen with formatting starting on the x and y position and 130// Draws text to the screen with formatting starting on the x and y position and
131// with custom character spacing. 131// with custom character spacing.
132#define txt_drawf(msg, x, y, s, ...) \ 132#define txt_drawf(msg, x, y, s, c, ...) \
133 { \ 133 { \
134 char buf[256] = {0}; \ 134 char buf[256] = {0}; \
135 posprintf(buf, msg, ##__VA_ARGS__); \ 135 posprintf(buf, msg, ##__VA_ARGS__); \
136 txt_draws(buf, x, y, s); \ 136 txt_draws(buf, x, y, s, c); \
137 } 137 }
138 138
139#endif // TEXT_H 139#endif // TEXT_H