diff options
author | jsorg71 <jsorg71> | 2005-11-10 02:37:57 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2005-11-10 02:37:57 +0000 |
commit | 9c4708743021a39e62a016d4e5efb5a78825bda3 (patch) | |
tree | 3a383594f1a5cb122c27dc2363844ae612bfd999 /rdp/rdp_orders.c | |
parent | e1c89f807c30674e479b0ef12268ccf119c03b8c (diff) | |
download | xrdp-proprietary-9c4708743021a39e62a016d4e5efb5a78825bda3.tar.gz xrdp-proprietary-9c4708743021a39e62a016d4e5efb5a78825bda3.zip |
8 /16 bpp client fixes
Diffstat (limited to 'rdp/rdp_orders.c')
-rw-r--r-- | rdp/rdp_orders.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/rdp/rdp_orders.c b/rdp/rdp_orders.c index 3a452312..1dafae60 100644 --- a/rdp/rdp_orders.c +++ b/rdp/rdp_orders.c @@ -1084,7 +1084,7 @@ rdp_orders_convert_bitmap(int in_bpp, int out_bpp, char* bmpdata, } if (in_bpp == 8 && out_bpp == 8) { - out = g_malloc(width * height, 0); + out = (char*)g_malloc(width * height, 0); src = bmpdata; dst = out; for (i = 0; i < height; i++) @@ -1102,6 +1102,26 @@ rdp_orders_convert_bitmap(int in_bpp, int out_bpp, char* bmpdata, } return out; } + if (in_bpp == 8 && out_bpp == 16) + { + out = (char*)g_malloc(width * height * 2, 0); + src = bmpdata; + dst = out; + for (i = 0; i < height; i++) + { + for (j = 0; j < width; j++) + { + pixel = *((unsigned char*)src); + pixel = palette[pixel]; + SPLITCOLOR32(red, green, blue, pixel); + pixel = COLOR16(red, green, blue); + *((unsigned short*)dst) = pixel; + src++; + dst += 2; + } + } + return out; + } return 0; } @@ -1126,5 +1146,12 @@ rdp_orders_convert_color(int in_bpp, int out_bpp, int in_color, int* palette) pixel = COLOR8(red, green, blue); return pixel; } + if (in_bpp == 8 && out_bpp == 16) + { + pixel = palette[in_color]; + SPLITCOLOR32(red, green, blue, pixel); + pixel = COLOR16(red, green, blue); + return pixel; + } return 0; } |