201 |
static uint32 |
static uint32 |
202 |
make_colour24(PixelColour pc) |
make_colour24(PixelColour pc) |
203 |
{ |
{ |
204 |
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
if (g_xserver_be) |
205 |
|
{ |
206 |
|
return pc.red | (pc.green << 8) | (pc.blue << 16); |
207 |
|
} |
208 |
|
else |
209 |
|
{ |
210 |
|
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
211 |
|
} |
212 |
} |
} |
213 |
|
|
214 |
static uint32 |
static uint32 |
215 |
make_colour32(PixelColour pc) |
make_colour32(PixelColour pc) |
216 |
{ |
{ |
217 |
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
if (g_xserver_be) |
218 |
|
{ |
219 |
|
return pc.red | (pc.green << 8) | (pc.blue << 16); |
220 |
|
} |
221 |
|
else |
222 |
|
{ |
223 |
|
return (pc.red << 16) | (pc.green << 8) | pc.blue; |
224 |
|
} |
225 |
} |
} |
226 |
|
|
227 |
#define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); } |
#define BSWAP16(x) { x = (((x & 0xff) << 8) | (x >> 8)); } |
358 |
static void |
static void |
359 |
translate15to32(uint16 * data, uint32 * out, uint32 * end) |
translate15to32(uint16 * data, uint32 * out, uint32 * end) |
360 |
{ |
{ |
361 |
|
uint16 pixel; |
362 |
|
|
363 |
while (out < end) |
while (out < end) |
364 |
*(out++) = make_colour32(split_colour15(*(data++))); |
{ |
365 |
|
if (g_host_be) |
366 |
|
{ |
367 |
|
pixel = *(data++); |
368 |
|
pixel = (pixel & 0xff) << 8 | (pixel & 0xff00) >> 8; |
369 |
|
*(out++) = make_colour32(split_colour15(pixel)); |
370 |
|
} |
371 |
|
else |
372 |
|
{ |
373 |
|
*(out++) = make_colour32(split_colour15(*(data++))); |
374 |
|
} |
375 |
|
} |
376 |
} |
} |
377 |
|
|
378 |
static void |
static void |
400 |
static void |
static void |
401 |
translate16to32(uint16 * data, uint32 * out, uint32 * end) |
translate16to32(uint16 * data, uint32 * out, uint32 * end) |
402 |
{ |
{ |
403 |
|
uint16 pixel; |
404 |
|
|
405 |
while (out < end) |
while (out < end) |
406 |
*(out++) = make_colour32(split_colour16(*(data++))); |
{ |
407 |
|
if (g_host_be) |
408 |
|
{ |
409 |
|
pixel = *(data++); |
410 |
|
pixel = (pixel & 0xff) << 8 | (pixel & 0xff00) >> 8; |
411 |
|
*(out++) = make_colour32(split_colour16(pixel)); |
412 |
|
} |
413 |
|
else |
414 |
|
{ |
415 |
|
*(out++) = make_colour32(split_colour16(*(data++))); |
416 |
|
} |
417 |
|
} |
418 |
} |
} |
419 |
|
|
420 |
static void |
static void |
445 |
uint32 pixel = 0; |
uint32 pixel = 0; |
446 |
while (out < end) |
while (out < end) |
447 |
{ |
{ |
448 |
pixel = *(data++); |
if (g_host_be) |
449 |
pixel |= *(data++) << 8; |
{ |
450 |
pixel |= *(data++) << 16; |
pixel = *(data++) << 16; |
451 |
|
pixel |= *(data++) << 8; |
452 |
|
pixel |= *(data++); |
453 |
|
} |
454 |
|
else |
455 |
|
{ |
456 |
|
pixel = *(data++); |
457 |
|
pixel |= *(data++) << 8; |
458 |
|
pixel |= *(data++) << 16; |
459 |
|
} |
460 |
*(out++) = pixel; |
*(out++) = pixel; |
461 |
} |
} |
462 |
} |
} |
882 |
if (tr.scancode == 0) |
if (tr.scancode == 0) |
883 |
break; |
break; |
884 |
|
|
885 |
save_remote_modifiers(); |
save_remote_modifiers(tr.scancode); |
886 |
ensure_remote_modifiers(ev_time, tr); |
ensure_remote_modifiers(ev_time, tr); |
887 |
rdp_send_scancode(ev_time, RDP_KEYPRESS, tr.scancode); |
rdp_send_scancode(ev_time, RDP_KEYPRESS, tr.scancode); |
888 |
restore_remote_modifiers(); |
restore_remote_modifiers(ev_time, tr.scancode); |
889 |
|
|
890 |
break; |
break; |
891 |
|
|