summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-01-16 16:43:30 +0100
committerMichael Lutz <michi@icosahedron.de>2021-02-22 22:16:07 +0100
commit70aa3b401145ec6bb98073a2758206cf63e15da1 (patch)
tree167cef03688a11e5c4a6b44cb300c9fd33d1d0bb /src/fontcache.cpp
parente7e53163404d4bb04b1213fccfb0772596b37f95 (diff)
downloadopenttd-70aa3b401145ec6bb98073a2758206cf63e15da1.tar.xz
Codechange: Give sprite encoders a hint which colour components of a sprite are filled with useful information.
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index be36ac107..8ed8708aa 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -351,6 +351,7 @@ const Sprite *TrueTypeFontCache::GetGlyph(GlyphID key)
0, // x_offs
0, // y_offs
ST_FONT,
+ SCC_PAL,
builtin_questionmark_data
};
@@ -614,6 +615,7 @@ const Sprite *FreeTypeFontCache::InternalGetGlyph(GlyphID key, bool aa)
SpriteLoader::Sprite sprite;
sprite.AllocateData(ZOOM_LVL_NORMAL, width * height);
sprite.type = ST_FONT;
+ sprite.colours = (aa ? SCC_PAL | SCC_ALPHA : SCC_PAL);
sprite.width = width;
sprite.height = height;
sprite.x_offs = slot->bitmap_left;
@@ -676,7 +678,6 @@ const void *FreeTypeFontCache::InternalGetFontTable(uint32 tag, size_t &length)
length = len;
return result;
}
-
#endif /* WITH_FREETYPE */