driver/fontrenderer: adding an additional bool to RenderString() seems inappropriate.

Origin commit data
------------------
Commit: 2047b51780
Author: martii <m4rtii@gmx.de>
Date: 2013-07-24 (Wed, 24 Jul 2013)
This commit is contained in:
martii
2013-07-24 18:00:09 +02:00
committed by vanhofen
parent 5734a0a464
commit 3414e8b997
2 changed files with 15 additions and 7 deletions

View File

@@ -395,8 +395,10 @@ void Font::paintFontPixel(fb_pixel_t *td, uint8_t fg_trans, uint8_t fg_red, uint
((fg_blue + ((korr_b*faktor)/F_MUL)) & 0x000000FF);
}
void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const bool utf8_encoded, const bool useFullBg)
void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const unsigned int flags)
{
const bool utf8_encoded = flags & IS_UTF8;
const bool useFullBg = flags & FULLBG;
/*
useFullBg (default = false)
@@ -644,14 +646,14 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f
pen1 = x;
lastindex = index;
}
//printf("RenderStat: %d %d %d \n", renderer->cacheManager->num_nodes, renderer->cacheManager->num_bytes, renderer->cacheManager->max_bytes);
//printf("RenderStat: %d %d %d \n", renderer->cacheManager->num_nodes, renderer->cacheManager->num_bytes, renderer->cacheManager->max_bytes);
pthread_mutex_unlock( &renderer->render_mutex );
frameBuffer->checkFbArea(x, y-height, width, height, false);
}
void Font::RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight, const bool utf8_encoded, const bool useFullBg)
void Font::RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight, const unsigned int flags)
{
RenderString(x, y, width, text.c_str(), color, boxheight, utf8_encoded, useFullBg);
RenderString(x, y, width, text.c_str(), color, boxheight, flags);
}
int Font::getRenderWidth(const char *text, const bool utf8_encoded)

View File

@@ -65,8 +65,14 @@ class Font
};
fontmodifier stylemodifier;
void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const bool utf8_encoded = false, const bool useFullBg = false);
void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const bool utf8_encoded = false, const bool useFullBg = false);
enum renderflags
{
IS_UTF8 = 1,
FULLBG = 2
};
void RenderString(int x, int y, const int width, const char * text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = 0);
void RenderString(int x, int y, const int width, const std::string & text, const fb_pixel_t color, const int boxheight = 0, const unsigned int flags = 0);
int getRenderWidth(const char * text, const bool utf8_encoded = false);
int getRenderWidth(const std::string & text, const bool utf8_encoded = false);