diff options
author | jsorg71 <jsorg71> | 2009-02-23 08:45:41 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2009-02-23 08:45:41 +0000 |
commit | 67911e9fb9638d9fa2005c060867b2736bd25bf2 (patch) | |
tree | 722402a52c206015c5c300298ec27e4bed5d72db | |
parent | 7c7bbf1edc1cf9ae4fefba359405983dd5d0d351 (diff) | |
download | xrdp-proprietary-67911e9fb9638d9fa2005c060867b2736bd25bf2.tar.gz xrdp-proprietary-67911e9fb9638d9fa2005c060867b2736bd25bf2.zip |
added 15bpp support
-rw-r--r-- | sesman/libscp/libscp_session.c | 1 | ||||
-rw-r--r-- | vnc/vnc.c | 29 |
2 files changed, 28 insertions, 2 deletions
diff --git a/sesman/libscp/libscp_session.c b/sesman/libscp/libscp_session.c index 13d0b13a..77cda2b8 100644 --- a/sesman/libscp/libscp_session.c +++ b/sesman/libscp/libscp_session.c @@ -126,6 +126,7 @@ scp_session_set_bpp(struct SCP_SESSION* s, tui8 bpp) switch (bpp) { case 8: + case 15: case 16: case 24: s->bpp = bpp; @@ -777,6 +777,12 @@ split_color(int pixel, int* r, int* g, int* b, int bpp, int* palette) *b = (palette[pixel] >> 0) & 0xff; } } + else if (bpp == 15) + { + *r = ((pixel >> 7) & 0xf8) | ((pixel >> 12) & 0x7); + *g = ((pixel >> 2) & 0xf8) | ((pixel >> 8) & 0x7); + *b = ((pixel << 3) & 0xf8) | ((pixel >> 2) & 0x7); + } else if (bpp == 16) { *r = ((pixel >> 8) & 0xf8) | ((pixel >> 13) & 0x7); @@ -1146,9 +1152,10 @@ lib_mod_connect(struct vnc* v) v->server_msg(v, "started connecting", 0); check_sec_result = 1; /* only support 8 and 16 bpp connections from rdp client */ - if ((v->server_bpp != 8) && (v->server_bpp != 16) && (v->server_bpp != 24)) + if ((v->server_bpp != 8) && (v->server_bpp != 15) && + (v->server_bpp != 16) && (v->server_bpp != 24)) { - v->server_msg(v, "error - only supporting 8, 16 and 24 bpp rdp \ + v->server_msg(v, "error - only supporting 8, 15, 16 and 24 bpp rdp \ connections", 0); return 1; } @@ -1297,6 +1304,24 @@ connections", 0); out_uint8(pixel_format, 0); /* blue shift */ out_uint8s(pixel_format, 3); /* pad */ } + else if (v->mod_bpp == 15) + { + out_uint8(pixel_format, 16); /* bits per pixel */ + out_uint8(pixel_format, 15); /* depth */ +#if defined(B_ENDIAN) + out_uint8(pixel_format, 1); /* big endian */ +#else + out_uint8(pixel_format, 0); /* big endian */ +#endif + out_uint8(pixel_format, 1); /* true color flag */ + out_uint16_be(pixel_format, 31); /* red max */ + out_uint16_be(pixel_format, 31); /* green max */ + out_uint16_be(pixel_format, 31); /* blue max */ + out_uint8(pixel_format, 10); /* red shift */ + out_uint8(pixel_format, 5); /* green shift */ + out_uint8(pixel_format, 0); /* blue shift */ + out_uint8s(pixel_format, 3); /* pad */ + } else if (v->mod_bpp == 16) { out_uint8(pixel_format, 16); /* bits per pixel */ |