From e66b57cd8894dcea92b6f629c3cc39deb8d9a13b Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 6 Apr 2013 17:47:06 +0200 Subject: [PATCH] fontrenderer: use background color of framebuffer --- src/driver/fontrenderer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 662e3968a..163c8aaa0 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -432,7 +432,10 @@ void Font::RenderString(int x, int y, const int width, const char *text, const u static fb_pixel_t oldbgcolor = 0, oldfgcolor = 0; static fb_pixel_t colors[256]={0}; - fb_pixel_t bgcolor = frameBuffer->realcolor[color]; + /* fetch bgcolor from framebuffer, using lower left edge of the font... */ + fb_pixel_t bgcolor = *(frameBuffer->getFrameBufferPointer() + x + + y * frameBuffer->getStride() / sizeof(fb_pixel_t)); + // fb_pixel_t bgcolor = frameBuffer->realcolor[color]; fb_pixel_t fgcolor = frameBuffer->realcolor[(((((int)color) + 2) | 7) - 2)]; if((oldbgcolor != bgcolor) || (oldfgcolor != fgcolor)) {