From 038e6575eadeab10dcceb02181154d5f1b2776cc Mon Sep 17 00:00:00 2001 From: Lyberta Date: Fri, 15 Jun 2018 18:40:26 +0300 Subject: [PATCH] Waypoint icons: Better drawing algorithm. --- .../mutators/mutator/waypoints/waypointsprites.qc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 326a26219..1eebd8ed8 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -426,10 +426,17 @@ vector drawsprite_TextOrIcon(bool is_text, vector o, float ang, float minwidth, o.x += 0.5 * (w - sw); - if (is_text) - drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL); - else - drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL); + if (is_text) + { + drawstring(o, str, sz, rgb, a, DRAWFLAG_NORMAL); + } + else + { + drawpic(o, str, sz, rgb, a, DRAWFLAG_NORMAL); + // https://docs.gimp.org/en/gimp-tool-desaturate.html + float gray = rgb.x * 0.21 + rgb.y * 0.72 + rgb.z * 0.07; + drawpic(o, str, sz, '1 1 1', gray * a, DRAWFLAG_ADDITIVE); + } o.x += 0.5 * sw; o.y += 0.5 * h; -- 2.39.2