From 40b7193cefa59e66fd9f8904960eb6dda28499ec Mon Sep 17 00:00:00 2001 From: Eukara Date: Tue, 17 Sep 2019 18:43:59 +0000 Subject: [PATCH] Grayscale Half-Life fonts upon loading them git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5545 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/gl/gl_font.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/engine/gl/gl_font.c b/engine/gl/gl_font.c index 06fd9bfc3..a7bae3ad9 100644 --- a/engine/gl/gl_font.c +++ b/engine/gl/gl_font.c @@ -1191,9 +1191,12 @@ static struct charcache_s *Font_TryLoadGlyph(font_t *f, CHARIDXTYPE charidx) } else { - out[(x+y*gw)*4+0] = pal[*in*3+0]; - out[(x+y*gw)*4+1] = pal[*in*3+1]; - out[(x+y*gw)*4+2] = pal[*in*3+2]; + qbyte val; + val = max(pal[*in*3+0], pal[*in*3+1]); + val = max(val, pal[*in*3+2]); + out[(x+y*gw)*4+0] = + out[(x+y*gw)*4+1] = + out[(x+y*gw)*4+2] = val; out[(x+y*gw)*4+3] = 0xff; } }