Changeset - r25793:51135ca0482f
[Not reviewed]
master
0 1 0
Rubidium - 3 years ago 2021-07-10 08:37:46
rubidium@openttd.org
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.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/fontcache.cpp
Show inline comments
 
@@ -618,9 +618,9 @@ const Sprite *FreeTypeFontCache::Interna
 
	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;
 
				}
 
			}
 
		}
0 comments (0 inline, 0 general)