need 24 bit RGB and BGR macros

ulab-original
jsorg71 18 years ago
parent 1cd6c0c2fc
commit 99e7f9d8ca

@ -64,7 +64,8 @@
) )
#define COLOR15(r, g, b) ((((r) >> 3) << 10) | (((g) >> 3) << 5) | ((b) >> 3)) #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 COLOR16(r, g, b) ((((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3))
#define COLOR24(r, g, b) ((r) | ((g) << 8) | ((b) << 16)) #define COLOR24RGB(r, g, b) (((r) << 16) | ((g) << 8) | (b))
#define COLOR24BGR(r, g, b) (((b) << 16) | ((g) << 8) | (r))
#define SPLITCOLOR15(r, g, b, c) \ #define SPLITCOLOR15(r, g, b, c) \
{ \ { \
r = (((c) >> 7) & 0xf8) | (((c) >> 12) & 0x7); \ r = (((c) >> 7) & 0xf8) | (((c) >> 12) & 0x7); \

@ -429,9 +429,9 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
} }
else if (self->bpp == 24) else if (self->bpp == 24)
{ {
color = COLOR24((color & 0xff0000) >> 16, //color = COLOR24((color & 0xff0000) >> 16,
(color & 0x00ff00) >> 8, // (color & 0x00ff00) >> 8,
(color & 0x0000ff) >> 0); // (color & 0x0000ff) >> 0);
} }
xrdp_bitmap_set_pixel(self, j, i, color); xrdp_bitmap_set_pixel(self, j, i, color);
} }

@ -309,14 +309,14 @@ xrdp_wm_load_static_colors(struct xrdp_wm* self)
} }
else if (self->screen->bpp == 24) else if (self->screen->bpp == 24)
{ {
self->black = COLOR24(0, 0, 0); self->black = COLOR24BGR(0, 0, 0);
self->grey = COLOR24(0xc0, 0xc0, 0xc0); self->grey = COLOR24BGR(0xc0, 0xc0, 0xc0);
self->dark_grey = COLOR24(0x80, 0x80, 0x80); self->dark_grey = COLOR24BGR(0x80, 0x80, 0x80);
self->blue = COLOR24(0x00, 0x00, 0xff); self->blue = COLOR24BGR(0x00, 0x00, 0xff);
self->dark_blue = COLOR24(0x00, 0x00, 0x7f); self->dark_blue = COLOR24BGR(0x00, 0x00, 0x7f);
self->white = COLOR24(0xff, 0xff, 0xff); self->white = COLOR24BGR(0xff, 0xff, 0xff);
self->red = COLOR24(0xff, 0x00, 0x00); self->red = COLOR24BGR(0xff, 0x00, 0x00);
self->green = COLOR24(0x00, 0xff, 0x00); self->green = COLOR24BGR(0x00, 0xff, 0x00);
} }
return 0; return 0;
} }

Loading…
Cancel
Save