more fixes for 32 bit color

ulab-next-nosound
Jay Sorg 11 years ago
parent d9b87e734b
commit 73bdb57ee2

@ -49,17 +49,20 @@ xrdp_bitmap32_compress(char *in_data, int width, int height,
int jindex; int jindex;
int cx; int cx;
int cy; int cy;
int header;
alpha_data = g_malloc(width * height * 4, 0); header = 0x20; /* no alpha TODO */
red_data = alpha_data + width * height;
green_data = red_data + width * height; cx = width + e;
blue_data = green_data + width * height; cy = 0;
alpha_data = g_malloc(cx * height * 4, 0);
red_data = alpha_data + cx * height;
green_data = red_data + cx * height;
blue_data = green_data + cx * height;
alpha_bytes = 0; alpha_bytes = 0;
red_bytes = 0; red_bytes = 0;
green_bytes = 0; green_bytes = 0;
blue_bytes = 0; blue_bytes = 0;
cx = width;
cy = 0;
/* split planes */ /* split planes */
while (start_line >= 0) while (start_line >= 0)
@ -78,14 +81,29 @@ xrdp_bitmap32_compress(char *in_data, int width, int height,
blue_data[blue_bytes] = pixel >> 0; blue_data[blue_bytes] = pixel >> 0;
blue_bytes++; blue_bytes++;
} }
for (iindex = 0; iindex < e; iindex++)
{
alpha_data[alpha_bytes] = 0;
alpha_bytes++;
red_data[red_bytes] = 0;
red_bytes++;
green_data[green_bytes] = 0;
green_bytes++;
blue_data[blue_bytes] = 0;
blue_bytes++;
}
start_line--; start_line--;
cy++; cy++;
} }
out_uint8(s, 0x20); /* no alpha */ out_uint8(s, header);
out_uint8a(s, red_data, red_bytes); out_uint8a(s, red_data, red_bytes);
out_uint8a(s, green_data, green_bytes); out_uint8a(s, green_data, green_bytes);
out_uint8a(s, blue_data, blue_bytes); out_uint8a(s, blue_data, blue_bytes);
out_uint8(s, 0x00); if ((header & 0x10) == 0)
{
/* pad if no RLE */
out_uint8(s, 0x00);
}
g_free(alpha_data); g_free(alpha_data);
return cy; return cy;
} }

@ -1563,7 +1563,7 @@ convert_pixel(int in_pixel)
if (g_rdpScreen.depth == 24) if (g_rdpScreen.depth == 24)
{ {
if (g_rdpScreen.rdp_bpp == 24) if (g_rdpScreen.rdp_bpp >= 24)
{ {
rv = in_pixel; rv = in_pixel;
SPLITCOLOR32(red, green, blue, rv); SPLITCOLOR32(red, green, blue, rv);
@ -1619,7 +1619,7 @@ convert_pixels(void *src, void *dst, int num_pixels)
{ {
src32 = (unsigned int *)src; src32 = (unsigned int *)src;
if (g_rdpScreen.rdp_bpp == 24) if (g_rdpScreen.rdp_bpp >= 24)
{ {
dst32 = (unsigned int *)dst; dst32 = (unsigned int *)dst;

@ -178,11 +178,11 @@ lib_mod_connect(struct mod *mod)
mod->server_msg(mod, "started connecting", 0); mod->server_msg(mod, "started connecting", 0);
/* only support 8, 15, 16, and 24 bpp connections from rdp client */ /* only support 8, 15, 16, 24, and 32 bpp connections from rdp client */
if (mod->bpp != 8 && mod->bpp != 15 && mod->bpp != 16 && mod->bpp != 24) if (mod->bpp != 8 && mod->bpp != 15 && mod->bpp != 16 && mod->bpp != 24 && mod->bpp != 32)
{ {
mod->server_msg(mod, mod->server_msg(mod,
"error - only supporting 8, 15, 16, and 24 bpp rdp connections", 0); "error - only supporting 8, 15, 16, 24, and 32 bpp rdp connections", 0);
LIB_DEBUG(mod, "out lib_mod_connect error"); LIB_DEBUG(mod, "out lib_mod_connect error");
return 1; return 1;
} }

Loading…
Cancel
Save