summaryrefslogtreecommitdiffstats
path: root/rdp
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-11-10 02:37:57 +0000
committerjsorg71 <jsorg71>2005-11-10 02:37:57 +0000
commit9c4708743021a39e62a016d4e5efb5a78825bda3 (patch)
tree3a383594f1a5cb122c27dc2363844ae612bfd999 /rdp
parente1c89f807c30674e479b0ef12268ccf119c03b8c (diff)
downloadxrdp-proprietary-9c4708743021a39e62a016d4e5efb5a78825bda3.tar.gz
xrdp-proprietary-9c4708743021a39e62a016d4e5efb5a78825bda3.zip
8 /16 bpp client fixes
Diffstat (limited to 'rdp')
-rw-r--r--rdp/rdp_orders.c29
-rw-r--r--rdp/rdp_rdp.c4
-rw-r--r--rdp/rdp_sec.c2
3 files changed, 31 insertions, 4 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;
}
diff --git a/rdp/rdp_rdp.c b/rdp/rdp_rdp.c
index 36743dd8..62cef281 100644
--- a/rdp/rdp_rdp.c
+++ b/rdp/rdp_rdp.c
@@ -153,7 +153,7 @@ rdp_rdp_out_bitmap_caps(struct rdp_rdp* self, struct stream* s)
{
out_uint16_le(s, RDP_CAPSET_BITMAP);
out_uint16_le(s, RDP_CAPLEN_BITMAP);
- out_uint16_le(s, self->mod->xrdp_bpp); /* Preferred BPP */
+ out_uint16_le(s, self->mod->rdp_bpp); /* Preferred BPP */
out_uint16_le(s, 1); /* Receive 1 BPP */
out_uint16_le(s, 1); /* Receive 4 BPP */
out_uint16_le(s, 1); /* Receive 8 BPP */
@@ -220,7 +220,7 @@ rdp_rdp_out_bmpcache_caps(struct rdp_rdp* self, struct stream* s)
out_uint16_le(s, RDP_CAPSET_BMPCACHE);
out_uint16_le(s, RDP_CAPLEN_BMPCACHE);
- Bpp = (self->mod->xrdp_bpp + 7) / 8;
+ Bpp = (self->mod->rdp_bpp + 7) / 8;
out_uint8s(s, 24); /* unused */
out_uint16_le(s, 0x258); /* entries */
out_uint16_le(s, 0x100 * Bpp); /* max cell size */
diff --git a/rdp/rdp_sec.c b/rdp/rdp_sec.c
index 38ee73b3..0bd727ee 100644
--- a/rdp/rdp_sec.c
+++ b/rdp/rdp_sec.c
@@ -209,7 +209,7 @@ rdp_sec_out_mcs_data(struct rdp_sec* self)
out_uint16_le(s, 0xca01); /* color depth? */
out_uint16_le(s, 1);
out_uint32_le(s, 0);
- out_uint8(s, self->rdp_layer->mod->xrdp_bpp);
+ out_uint8(s, self->rdp_layer->mod->rdp_bpp);
out_uint16_le(s, 0x0700);
out_uint8(s, 0);
out_uint32_le(s, 1);