summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubidium <rubidium@openttd.org>2021-07-10 10:37:46 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-07-10 11:27:09 +0200
commit0d0375c0194c5cb060fd88781da9d724702d0c1b (patch)
tree8ccb6dde89216acdc3e8cb37df49bb41f69d7223
parent1c0c4637d2d65194dcc10ab727a99ec74ea5d962 (diff)
downloadopenttd-0d0375c0194c5cb060fd88781da9d724702d0c1b.tar.xz
Remove: logically dead code from font cache
The outer if statement checks for 'aa' being false, so within the inner statements anything checking aa will have a known result and the other branch from there will be dead code.
-rw-r--r--src/fontcache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index bbdec4b72..deb651e37 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -618,9 +618,9 @@ const Sprite *FreeTypeFontCache::InternalGetGlyph(GlyphID key, bool aa)
if (this->fs == FS_NORMAL && !aa) {
for (uint y = 0; y < (uint)slot->bitmap.rows; y++) {
for (uint x = 0; x < (uint)slot->bitmap.width; x++) {
- if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
+ if (HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
sprite.data[1 + x + (1 + y) * sprite.width].m = SHADOW_COLOUR;
- sprite.data[1 + x + (1 + y) * sprite.width].a = aa ? slot->bitmap.buffer[x + y * slot->bitmap.pitch] : 0xFF;
+ sprite.data[1 + x + (1 + y) * sprite.width].a = 0xFF;
}
}
}