71 |
|
|
72 |
/* Read a colour entry */ |
/* Read a colour entry */ |
73 |
static void |
static void |
74 |
rdp_in_colour(STREAM s, uint8 * colour) |
rdp_in_colour(STREAM s, uint32 * colour) |
75 |
{ |
{ |
76 |
in_uint8(s, *colour); |
uint32 i; |
77 |
s->p += 2; |
in_uint8(s, i); |
78 |
|
*colour = i; |
79 |
|
in_uint8(s, i); |
80 |
|
*colour |= i << 8; |
81 |
|
in_uint8(s, i); |
82 |
|
*colour |= i << 16; |
83 |
} |
} |
84 |
|
|
85 |
/* Parse bounds information */ |
/* Parse bounds information */ |
284 |
static void |
static void |
285 |
process_rect(STREAM s, RECT_ORDER * os, uint32 present, BOOL delta) |
process_rect(STREAM s, RECT_ORDER * os, uint32 present, BOOL delta) |
286 |
{ |
{ |
287 |
|
uint32 i; |
288 |
if (present & 0x01) |
if (present & 0x01) |
289 |
rdp_in_coord(s, &os->x, delta); |
rdp_in_coord(s, &os->x, delta); |
290 |
|
|
298 |
rdp_in_coord(s, &os->cy, delta); |
rdp_in_coord(s, &os->cy, delta); |
299 |
|
|
300 |
if (present & 0x10) |
if (present & 0x10) |
301 |
in_uint8(s, os->colour); |
{ |
302 |
|
in_uint8(s, i); |
303 |
|
os->colour = (os->colour & 0xffffff00) | i; |
304 |
|
} |
305 |
|
|
306 |
|
if (present & 0x20) |
307 |
|
{ |
308 |
|
in_uint8(s, i); |
309 |
|
os->colour = (os->colour & 0xffff00ff) | (i << 8); |
310 |
|
} |
311 |
|
|
312 |
|
if (present & 0x40) |
313 |
|
{ |
314 |
|
in_uint8(s, i); |
315 |
|
os->colour = (os->colour & 0xff00ffff) | (i << 16); |
316 |
|
} |
317 |
|
|
318 |
DEBUG(("RECT(x=%d,y=%d,cx=%d,cy=%d,fg=0x%x)\n", os->x, os->y, os->cx, os->cy, os->colour)); |
DEBUG(("RECT(x=%d,y=%d,cx=%d,cy=%d,fg=0x%x)\n", os->x, os->y, os->cx, os->cy, os->colour)); |
319 |
|
|
653 |
in_uint16_le(s, bufsize); |
in_uint16_le(s, bufsize); |
654 |
in_uint16_le(s, cache_idx); |
in_uint16_le(s, cache_idx); |
655 |
in_uint8p(s, data, bufsize); |
in_uint8p(s, data, bufsize); |
656 |
|
if (bpp != 8) /* todo */ |
657 |
|
return; |
658 |
|
|
659 |
DEBUG(("RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx)); |
DEBUG(("RAW_BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx)); |
660 |
inverted = xmalloc(width * height); |
inverted = xmalloc(width * height); |
688 |
in_uint16_le(s, size); |
in_uint16_le(s, size); |
689 |
in_uint8s(s, 4); /* row_size, final_size */ |
in_uint8s(s, 4); /* row_size, final_size */ |
690 |
in_uint8p(s, data, size); |
in_uint8p(s, data, size); |
691 |
|
if (bpp != 8) /* todo */ |
692 |
|
return; |
693 |
|
|
694 |
DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx)); |
DEBUG(("BMPCACHE(cx=%d,cy=%d,id=%d,idx=%d)\n", width, height, cache_id, cache_idx)); |
695 |
|
|
696 |
bmpdata = xmalloc(width * height); |
bmpdata = xmalloc(width * height); |
697 |
|
|
698 |
if (bitmap_decompress(bmpdata, width, height, data, size)) |
if (bitmap_decompress(bmpdata, width, height, data, size, bpp)) |
699 |
{ |
{ |
700 |
bitmap = ui_create_bitmap(width, height, bmpdata); |
bitmap = ui_create_bitmap(width, height, bmpdata); |
701 |
cache_put_bitmap(cache_id, cache_idx, bitmap); |
cache_put_bitmap(cache_id, cache_idx, bitmap); |