diff options
author | June McEnroe <programble@gmail.com> | 2018-02-05 17:29:21 -0500 |
---|---|---|
committer | June McEnroe <programble@gmail.com> | 2018-02-05 17:29:21 -0500 |
commit | 373a74f4d7d104ba110e62b3f23887fc1109aa67 (patch) | |
tree | 998a6999e7a55dafa9ccb55144868d7183f6b0c1 /bin | |
parent | Set title in gfcocoa (diff) | |
download | src-373a74f4d7d104ba110e62b3f23887fc1109aa67.tar.gz src-373a74f4d7d104ba110e62b3f23887fc1109aa67.zip |
Always skip most significant bits in gfxx
This works for CARDS.DLL but might not for other things. We'll see.
Diffstat (limited to '')
-rw-r--r-- | bin/gfxx.c | 4 |
1 files 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]); } |