Use new single-color overload in font where possible
This commit is contained in:
parent
a21d162d5a
commit
ce1cbd44da
@ -602,8 +602,6 @@ void ScalableFont::draw(const core::stringw& text,
|
|||||||
|
|
||||||
core::rect<s32> dest(offsets[n] + core::position2di(0, y_shift), size);
|
core::rect<s32> dest(offsets[n] + core::position2di(0, y_shift), size);
|
||||||
|
|
||||||
video::SColor colors[] = {color, color, color, color};
|
|
||||||
|
|
||||||
video::ITexture* texture = (fallback[n] ?
|
video::ITexture* texture = (fallback[n] ?
|
||||||
m_fallback_font->SpriteBank->getTexture(texID) :
|
m_fallback_font->SpriteBank->getTexture(texID) :
|
||||||
SpriteBank->getTexture(texID) );
|
SpriteBank->getTexture(texID) );
|
||||||
@ -644,7 +642,6 @@ void ScalableFont::draw(const core::stringw& text,
|
|||||||
{
|
{
|
||||||
// draw black border
|
// draw black border
|
||||||
video::SColor black(color.getAlpha(),0,0,0);
|
video::SColor black(color.getAlpha(),0,0,0);
|
||||||
video::SColor black_colors[] = {black, black, black, black};
|
|
||||||
|
|
||||||
for (int x_delta=-2; x_delta<=2; x_delta++)
|
for (int x_delta=-2; x_delta<=2; x_delta++)
|
||||||
{
|
{
|
||||||
@ -652,10 +649,10 @@ void ScalableFont::draw(const core::stringw& text,
|
|||||||
{
|
{
|
||||||
if (x_delta == 0 || y_delta == 0) continue;
|
if (x_delta == 0 || y_delta == 0) continue;
|
||||||
draw2DImage(texture,
|
draw2DImage(texture,
|
||||||
dest + core::position2d<s32>(x_delta, y_delta),
|
dest + core::position2d<s32>(x_delta, y_delta),
|
||||||
source,
|
source,
|
||||||
clip,
|
clip,
|
||||||
black_colors, true);
|
black, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -667,18 +664,18 @@ void ScalableFont::draw(const core::stringw& text,
|
|||||||
static video::SColor yellow(color.getAlpha(), 255, 220, 15);
|
static video::SColor yellow(color.getAlpha(), 255, 220, 15);
|
||||||
video::SColor title_colors[] = {yellow, orange, orange, yellow};
|
video::SColor title_colors[] = {yellow, orange, orange, yellow};
|
||||||
draw2DImage(texture,
|
draw2DImage(texture,
|
||||||
dest,
|
dest,
|
||||||
source,
|
source,
|
||||||
clip,
|
clip,
|
||||||
title_colors, true);
|
title_colors, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
draw2DImage(texture,
|
draw2DImage(texture,
|
||||||
dest,
|
dest,
|
||||||
source,
|
source,
|
||||||
clip,
|
clip,
|
||||||
colors, true);
|
color, true);
|
||||||
|
|
||||||
#ifdef FONT_DEBUG
|
#ifdef FONT_DEBUG
|
||||||
driver->draw2DLine(core::position2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y),
|
driver->draw2DLine(core::position2d<s32>(dest.UpperLeftCorner.X, dest.UpperLeftCorner.Y),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user