diff options
author | jaseg <jaseg@jaseg.net> | 2014-01-03 00:10:20 +0100 |
---|---|---|
committer | jaseg <jaseg@jaseg.net> | 2014-01-03 00:10:20 +0100 |
commit | 916aced1bef07001ef4eee2a1cde6cd6e33b4bc3 (patch) | |
tree | a8af06f0dcc65645801a2e20db64ca877b288f98 /host/matelight/font.c | |
parent | 34def4f660108632a9526c9ad3195fdb883d206d (diff) | |
download | matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.tar.gz matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.tar.bz2 matelight-916aced1bef07001ef4eee2a1cde6cd6e33b4bc3.zip |
Now with even more abstract art.
Diffstat (limited to 'host/matelight/font.c')
-rw-r--r-- | host/matelight/font.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 <stdlib.h> #include <string.h> -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; } } |