From 10ec8c90d46a7c4be3937052b4a76145ebfdd179 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 4 Jan 2025 13:08:49 +0200 Subject: [PATCH] Blacker than black update --- gfxutil.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gfxutil.cpp b/gfxutil.cpp index 50f4f5d1..3501feb3 100644 --- a/gfxutil.cpp +++ b/gfxutil.cpp @@ -344,6 +344,8 @@ void alloc_colors_picasso (int rw, int gw, int bw, int rs, int gs, int bs, int r #endif } +#define BLACKERTHANBLACKADJ 4 + void alloc_colors_rgb (int rw, int gw, int bw, int rs, int gs, int bs, int aw, int as, int alpha, int byte_swap, uae_u32 *rc, uae_u32 *gc, uae_u32 *bc) { @@ -353,7 +355,7 @@ void alloc_colors_rgb (int rw, int gw, int bw, int rs, int gs, int bs, int aw, i int j; if (!gfx_hdr && currprefs.gfx_blackerthanblack) { - j = i * 15 / 16 + 15; + j = i * (255 - BLACKERTHANBLACKADJ) / 255 + BLACKERTHANBLACKADJ; } else { j = i; } @@ -397,9 +399,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 (!gfx_hdr && currprefs.gfx_blackerthanblack) { - r = (r * (255 - 8) / 255) + 8; - g = (g * (255 - 8) / 255) + 8; - b = (b * (255 - 8) / 255) + 8; + r = (r * (255 - BLACKERTHANBLACKADJ) / 255) + BLACKERTHANBLACKADJ; + g = (g * (255 - BLACKERTHANBLACKADJ) / 255) + BLACKERTHANBLACKADJ; + b = (b * (255 - BLACKERTHANBLACKADJ) / 255) + BLACKERTHANBLACKADJ; } r = gamma[r + j][0]; g = gamma[g + j][1]; @@ -418,6 +420,7 @@ void alloc_colors64k(int monid, int rw, int gw, int bw, int rs, int gs, int bs, xcolors[i] |= xcolors[i] * 0x00010001; } } + fullblack = 0; if (gfx_hdr) { fullblack = doAlpha(1, aw, as); @@ -462,9 +465,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 = (r * (255 - 8) / 255) + 8; - g = (g * (255 - 8) / 255) + 8; - b = (b * (255 - 8) / 255) + 8; + r = (r * (255 - BLACKERTHANBLACKADJ) / 255) + BLACKERTHANBLACKADJ; + g = (g * (255 - BLACKERTHANBLACKADJ) / 255) + BLACKERTHANBLACKADJ; + b = (b * (255 - BLACKERTHANBLACKADJ) / 255) + BLACKERTHANBLACKADJ; } xcolors[i] = doMask(r, 5, 11) | doMask(g, 6, 5) | doMask(b, 5, 0); -- 2.47.3