summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2014-04-16 19:54:51 +0000
committerpeter1138 <peter1138@openttd.org>2014-04-16 19:54:51 +0000
commite943d355e2debb357ef43f15539f038c308e51ae (patch)
treed5c85c58ba59b4f242fc8d8318fec0aa9f24ed34 /src/gfx.cpp
parent9e578d358aaeb2c4d11f70bf5ee1d24d0bd673b4 (diff)
downloadopenttd-e943d355e2debb357ef43f15539f038c308e51ae.tar.xz
(svn r26467) -Fix: Include shadow on ...
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 40cea78c0..adc644d20 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -418,19 +418,21 @@ static int DrawLayoutLine(const ParagraphLayouter::Line *line, int y, int left,
NOT_REACHED();
}
+ TextColour colour = TC_BLACK;
+ bool draw_shadow = false;
for (int run_index = 0; run_index < line->CountRuns(); run_index++) {
const ParagraphLayouter::VisualRun *run = line->GetVisualRun(run_index);
const Font *f = (const Font*)run->GetFont();
FontCache *fc = f->fc;
- TextColour colour = f->colour;
+ colour = f->colour;
SetColourRemap(colour);
DrawPixelInfo *dpi = _cur_dpi;
int dpi_left = dpi->left;
int dpi_right = dpi->left + dpi->width - 1;
- bool draw_shadow = fc->GetDrawGlyphShadow() && colour != TC_BLACK;
+ draw_shadow = fc->GetDrawGlyphShadow() && colour != TC_BLACK;
for (int i = 0; i < run->GetGlyphCount(); i++) {
GlyphID glyph = run->GetGlyphs()[i];
@@ -461,6 +463,11 @@ static int DrawLayoutLine(const ParagraphLayouter::Line *line, int y, int left,
if (truncation) {
int x = (_current_text_dir == TD_RTL) ? left : (right - 3 * dot_width);
for (int i = 0; i < 3; i++, x += dot_width) {
+ if (draw_shadow) {
+ SetColourRemap(TC_BLACK);
+ GfxMainBlitter(dot_sprite, x + 1, y + 1, BM_COLOUR_REMAP);
+ SetColourRemap(colour);
+ }
GfxMainBlitter(dot_sprite, x, y, BM_COLOUR_REMAP);
}
}