From 916aced1bef07001ef4eee2a1cde6cd6e33b4bc3 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 3 Jan 2014 00:10:20 +0100 Subject: Now with even more abstract art. --- host/matelight/font.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'host/matelight/font.c') diff --git a/host/matelight/font.c b/host/matelight/font.c index 53d27b9..f22f05b 100644 --- a/host/matelight/font.c +++ b/host/matelight/font.c @@ -5,7 +5,7 @@ #include #include -void render_glyph(glyph_t *g, uint8_t *buf, unsigned int bufwidth, unsigned int offx, unsigned int offy){ +void render_glyph(glyph_t *g, uint8_t *buf, unsigned int bufwidth, unsigned int offx, unsigned int offy, color_t fg, color_t bg){ unsigned int bitmap_row_width = g->width/8; uint8_t *bitmap = ((uint8_t *)g) + sizeof(glyph_t); for(unsigned int y=0; y < g->height; y++){ @@ -16,7 +16,8 @@ void render_glyph(glyph_t *g, uint8_t *buf, unsigned int bufwidth, unsigned int } uint8_t *p = buf + (offy+y)*bufwidth + offx; for(unsigned int x=0; x < g->width; x++){ - *p++ = (data&(1<<(g->width-1))) ? 1 : 0; + color_t c = (data&(1<<(g->width-1))) ? fg : bg; + *((color_t *)(p++)) = c; data <<= 1; } } -- cgit