diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2012-01-30 08:21:29 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-02-03 23:59:35 +0100 |
commit | fc49eccb0cb0a1d6b3c12e173867473f8d3d4393 (patch) | |
tree | 0a93d8da1fb1e300b0dfd73c9ea52d9cfa0f87d2 | |
parent | 4a5e3404f9e5ad9da7e12ef509e823b0953e143a (diff) |
firmware/fb: Adding transparent background color for fonts
-rw-r--r-- | src/target/firmware/fb/fb_rgb332.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/target/firmware/fb/fb_rgb332.c b/src/target/firmware/fb/fb_rgb332.c index 26cbeec5..9955d16c 100644 --- a/src/target/firmware/fb/fb_rgb332.c +++ b/src/target/firmware/fb/fb_rgb332.c @@ -204,7 +204,7 @@ int fb_rgb332_putstr(char *str,int maxwidth){ int bitmap_x,bitmap_y; // coordinates in character's bitmap int byte_per_line; // depending on character width in font int bitmap_offs,bitmap_bit; // offset inside bitmap, bit number of pixel - uint8_t *p,fgpixel,bgpixel; // pointer into framebuffer memory + uint8_t *p,fgpixel,bgpixel,trans; // pointer into framebuffer memory int total_w; // total width /* center, if maxwidth < 0 */ @@ -236,6 +236,7 @@ int fb_rgb332_putstr(char *str,int maxwidth){ fgpixel = rgb_to_pixel(framebuffer->fg_color); bgpixel = rgb_to_pixel(framebuffer->bg_color); + trans = (framebuffer->bg_color == FB_COLOR_TRANSP); if(y1 < 0) // sanitize in case of overflow y1 = 0; @@ -288,7 +289,8 @@ int fb_rgb332_putstr(char *str,int maxwidth){ *p = fgpixel; } else { // unset, or outside bitmap outside_char_bitmap: - *p = bgpixel; + if (!trans) + *p = bgpixel; } p++; } // for(x...) |