diff options
author | jsorg71 <jsorg71> | 2005-11-10 04:38:39 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2005-11-10 04:38:39 +0000 |
commit | 3cdf8bdcee7d1ccbe270f919e416478ba1ca88d2 (patch) | |
tree | c8c0823405e9aab05734972723e0f852313cfb45 /common/defines.h | |
parent | 9c4708743021a39e62a016d4e5efb5a78825bda3 (diff) | |
download | xrdp-proprietary-3cdf8bdcee7d1ccbe270f919e416478ba1ca88d2.tar.gz xrdp-proprietary-3cdf8bdcee7d1ccbe270f919e416478ba1ca88d2.zip |
add SPLITCOLOR15 and 16
Diffstat (limited to 'common/defines.h')
-rw-r--r-- | common/defines.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/common/defines.h b/common/defines.h index cae15fc7..657f9e20 100644 --- a/common/defines.h +++ b/common/defines.h @@ -63,14 +63,27 @@ #define COLOR15(r, g, b) ((((r) >> 3) << 10) | (((g) >> 3) << 5) | ((b) >> 3)) #define COLOR16(r, g, b) ((((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3)) #define COLOR24(r, g, b) ((r) | ((g) << 8) | ((b) << 16)) +#define SPLITCOLOR15(r, g, b, c) \ +{ \ + r = (((c) >> 7) & 0xf8) | (((c) >> 12) & 0x7); \ + g = (((c) >> 2) & 0xf8) | (((c) >> 8) & 0x7); \ + b = (((c) << 3) & 0xf8) | (((c) >> 2) & 0x7); \ +} +#define SPLITCOLOR16(r, g, b, c) \ +{ \ + r = (((c) >> 8) & 0xf8) | (((c) >> 13) & 0x7); \ + g = (((c) >> 3) & 0xfc) | (((c) >> 9) & 0x3); \ + b = (((c) << 3) & 0xf8) | (((c) >> 2) & 0x7); \ +} #define SPLITCOLOR32(r, g, b, c) \ { \ - r = (c >> 16) & 0xff; \ - g = (c >> 8) & 0xff; \ - b = c & 0xff; \ + r = ((c) >> 16) & 0xff; \ + g = ((c) >> 8) & 0xff; \ + b = (c) & 0xff; \ } /* font macros */ -#define FONT_DATASIZE(f) ((((f)->height * (((f)->width + 7) / 8)) + 3) & ~3); +#define FONT_DATASIZE(f) \ + ((((f)->height * (((f)->width + 7) / 8)) + 3) & ~3); /* use crc for bitmap cache lookups */ #define USE_CRC |