mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Add integer representation for font color.
This commit is contained in:
parent
59298cd428
commit
df0791c054
3
Config.h
3
Config.h
|
@ -64,7 +64,8 @@ struct Config
|
|||
{
|
||||
std::string name;
|
||||
u32 size;
|
||||
float color[4];
|
||||
u8 color[4];
|
||||
float colorf[4];
|
||||
} font;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -278,7 +278,7 @@ void TextDrawer::renderText(const char *_pText, float _x, float _y) const
|
|||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
/* Set color */
|
||||
glUniform4fv(m_uColor, 1, config.font.color);
|
||||
glUniform4fv(m_uColor, 1, config.font.colorf);
|
||||
|
||||
/* Use the texture containing the atlas */
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
|
|
|
@ -180,10 +180,14 @@ void Config_LoadConfig()
|
|||
sprintf(buf, "0x%s", ConfigGetParamString(g_configVideoGliden64, "fontColor"));
|
||||
long int uColor = strtol(buf, NULL, 16);
|
||||
if (uColor != 0) {
|
||||
config.font.color[0] = _FIXED2FLOAT(_SHIFTR(uColor, 16, 8), 8);
|
||||
config.font.color[1] = _FIXED2FLOAT(_SHIFTR(uColor, 8, 8), 8);
|
||||
config.font.color[2] = _FIXED2FLOAT(_SHIFTR(uColor, 0, 8), 8);
|
||||
config.font.color[3] = 1.0f;
|
||||
config.font.color[0] = _SHIFTR(uColor, 16, 8);
|
||||
config.font.color[1] = _SHIFTR(uColor, 8, 8);
|
||||
config.font.color[2] = _SHIFTR(uColor, 0, 8);
|
||||
config.font.color[3] = 0xFF;
|
||||
config.font.colorf[0] = _FIXED2FLOAT(config.font.color[0], 8);
|
||||
config.font.colorf[1] = _FIXED2FLOAT(config.font.color[1], 8);
|
||||
config.font.colorf[2] = _FIXED2FLOAT(config.font.color[2], 8);
|
||||
config.font.colorf[3] = 1.0f;
|
||||
}
|
||||
config.font.size = ConfigGetParamInt(g_configVideoGliden64, "fontSize");
|
||||
if (config.font.size == 0)
|
||||
|
|
Loading…
Reference in New Issue
Block a user