From 373a74f4d7d104ba110e62b3f23887fc1109aa67 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 5 Feb 2018 17:29:21 -0500 Subject: Always skip most significant bits in gfxx This works for CARDS.DLL but might not for other things. We'll see. --- bin/gfxx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/gfxx.c b/bin/gfxx.c index 6d187cb9..11f9aa20 100644 --- a/bin/gfxx.c +++ b/bin/gfxx.c @@ -28,7 +28,7 @@ #define RGB(r,g,b) ((uint32_t)(r) << 16 | (uint32_t)(g) << 8 | (uint32_t)(b)) #define GRAY(n) RGB(n, n, n) -#define MASK(b) ((1 << b) - 1) +#define MASK(b) ((1 << (b)) - 1) #define SCALE(b,n) ((b) ? (uint8_t)(255 * (uint32_t)(n) / MASK(b)) : 0) static enum { @@ -208,7 +208,7 @@ static uint32_t interpolate(uint32_t n) { g = (n >>= bits[3]) & MASK(bits[2]); r = (n >>= bits[2]) & MASK(bits[1]); } else { - r = (n >>= bits[0]) & MASK(bits[1]); + r = n & MASK(bits[1]); g = (n >>= bits[1]) & MASK(bits[2]); b = (n >>= bits[2]) & MASK(bits[3]); } -- cgit 1.4.1 right'>
summary refs log tree commit diff
path: root/handle.c (unfollow)
Commit message (Expand)Author
2020-02-11Support monochromatic terminalsJune McEnroe
2020-02-11Add .gz to chroot-man scriptJune McEnroe
2020-02-11Add -R restricted flagJune McEnroe
2020-02-11Add chroot targetJune McEnroe
2020-02-11Exit focus and paste modes on err exitJune McEnroe
2020-02-11Add startup GPLv3 note and URLJune McEnroe
2020-02-11Make sure -D_GNU_SOURCE ends up in CFLAGS on LinuxJune McEnroe
2020-02-11Add note about setting PKG_CONFIG_PATHJune McEnroe
2020-02-11Rename query ID on nick changeJune McEnroe
2020-02-11Call completeClear when closing a windowJune McEnroe
2020-02-11Don't insert color codes for non-mentionsJune McEnroe
2020-02-11Take first two words in colorMentionsJune McEnroe
2020-02-11Use time_t for save signatureJune McEnroe
2020-02-11Set self.nick to * initiallyJune McEnroe
2020-02-11Define ColorCap instead of hardcoding 100June McEnroe
2020-02-11Move hash to top of chat.hJune McEnroe
2020-02-11Move base64 out of chat.hJune McEnroe
2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe
2020-02-11Fix whois idle unit calculationJune McEnroe
2020-02-11Cast towupper to wchar_tJune McEnroe
2020-02-11Cast set but unused variables to voidJune McEnroe
2020-02-11Declare strlcatJune McEnroe
2020-02-11Check if VDSUSP existsJune McEnroe
2020-02-11Fix completeReplace iterationJune McEnroe
2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe
2020-02-11Remove legacy codeJune McEnroe
2020-02-11Add INSTALLING section to READMEJune McEnroe