summaryrefslogtreecommitdiff
path: root/src/os
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/os
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/os')
-rw-r--r--src/os/macosx/font_osx.cpp1
-rw-r--r--src/os/windows/font_win32.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/os/macosx/font_osx.cpp b/src/os/macosx/font_osx.cpp
index 0a1b9e99a..04e5db9ab 100644
--- a/src/os/macosx/font_osx.cpp
+++ b/src/os/macosx/font_osx.cpp
@@ -286,6 +286,7 @@ const Sprite *CoreTextFontCache::InternalGetGlyph(GlyphID key, bool use_aa)
SpriteLoader::Sprite sprite;
sprite.AllocateData(ZOOM_LVL_NORMAL, width * height);
sprite.type = ST_FONT;
+ sprite.colours = (use_aa ? SCC_PAL | SCC_ALPHA : SCC_PAL);
sprite.width = width;
sprite.height = height;
sprite.x_offs = (int16)std::round(CGRectGetMinX(bounds));
diff --git a/src/os/windows/font_win32.cpp b/src/os/windows/font_win32.cpp
index 7df24828b..a3b60933c 100644
--- a/src/os/windows/font_win32.cpp
+++ b/src/os/windows/font_win32.cpp
@@ -495,6 +495,7 @@ void Win32FontCache::ClearFontCache()
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 = gm.gmptGlyphOrigin.x;