From: Toni Wilen Date: Sat, 20 Feb 2021 16:20:29 +0000 (+0200) Subject: Better OCS/ECS blacker than black fix X-Git-Tag: 4900~183 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=468cfbbdb0294ed5b68a7181e80f8f49fec51b9f;p=francis%2Fwinuae.git Better OCS/ECS blacker than black fix --- diff --git a/gfxutil.cpp b/gfxutil.cpp index 650792fc..1161c5d2 100644 --- a/gfxutil.cpp +++ b/gfxutil.cpp @@ -381,15 +381,9 @@ void alloc_colors64k(int monid, int rw, int gw, int bw, int rs, int gs, int bs, int b = ((i & 0xf) << 4) | (i & 0x0f); if (currprefs.gfx_blackerthanblack) { - r += 10; - g += 10; - b += 10; - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; + r = (r * (255 - 8) / 255) + 8; + g = (g * (255 - 8) / 255) + 8; + b = (b * (255 - 8) / 255) + 8; } r = gamma[r + j][0]; @@ -448,15 +442,9 @@ void alloc_colors64k(int monid, int rw, int gw, int bw, int rs, int gs, int bs, b = gamma[b + 256][2]; if (currprefs.gfx_blackerthanblack) { - r += 10; - g += 10; - b += 10; - if (r > 255) - r = 255; - if (g > 255) - g = 255; - if (b > 255) - b = 255; + r = (r * (255 - 8) / 255) + 8; + g = (g * (255 - 8) / 255) + 8; + b = (b * (255 - 8) / 255) + 8; } xcolors[i] = doMask(r, 5, 11) | doMask(g, 6, 5) | doMask(b, 5, 0);