8 /16 bpp client fixes

ulab-original
jsorg71 19 years ago
parent e1c89f807c
commit 9c47087430

@ -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;
}

@ -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 */

@ -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);

Loading…
Cancel
Save