From: Lyberta Date: Fri, 15 Jun 2018 15:40:26 +0000 (+0300) Subject: Waypoint icons: Better drawing algorithm. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=038e6575eadeab10dcceb02181154d5f1b2776cc;p=xonotic%2Fxonotic-data.pk3dir.git Waypoint icons: Better drawing algorithm. --- 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;