/[rdesktop]/sourceforge.net/rdesktop/trunk/orders.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/rdesktop/trunk/orders.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 846 by jdmeijer, Fri Mar 11 00:50:19 2005 UTC revision 1485 by astrand, Tue Nov 25 08:05:25 2008 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     RDP order processing     RDP order processing
4     Copyright (C) Matthew Chapman 1999-2005     Copyright (C) Matthew Chapman 1999-2008
5    
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 23  Line 23 
23    
24  extern uint8 *g_next_packet;  extern uint8 *g_next_packet;
25  static RDP_ORDER_STATE g_order_state;  static RDP_ORDER_STATE g_order_state;
26  extern BOOL g_use_rdp5;  extern RD_BOOL g_use_rdp5;
27    
28  /* Read field indicating which parameters are present */  /* Read field indicating which parameters are present */
29  static void  static void
# Line 55  rdp_in_present(STREAM s, uint32 * presen Line 55  rdp_in_present(STREAM s, uint32 * presen
55    
56  /* Read a co-ordinate (16-bit, or 8-bit delta) */  /* Read a co-ordinate (16-bit, or 8-bit delta) */
57  static void  static void
58  rdp_in_coord(STREAM s, sint16 * coord, BOOL delta)  rdp_in_coord(STREAM s, sint16 * coord, RD_BOOL delta)
59  {  {
60          sint8 change;          sint8 change;
61    
# Line 102  rdp_in_colour(STREAM s, uint32 * colour) Line 102  rdp_in_colour(STREAM s, uint32 * colour)
102  }  }
103    
104  /* Parse bounds information */  /* Parse bounds information */
105  static BOOL  static RD_BOOL
106  rdp_parse_bounds(STREAM s, BOUNDS * bounds)  rdp_parse_bounds(STREAM s, BOUNDS * bounds)
107  {  {
108          uint8 present;          uint8 present;
# Line 133  rdp_parse_bounds(STREAM s, BOUNDS * boun Line 133  rdp_parse_bounds(STREAM s, BOUNDS * boun
133  }  }
134    
135  /* Parse a pen */  /* Parse a pen */
136  static BOOL  static RD_BOOL
137  rdp_parse_pen(STREAM s, PEN * pen, uint32 present)  rdp_parse_pen(STREAM s, PEN * pen, uint32 present)
138  {  {
139          if (present & 1)          if (present & 1)
# Line 148  rdp_parse_pen(STREAM s, PEN * pen, uint3 Line 148  rdp_parse_pen(STREAM s, PEN * pen, uint3
148          return s_check(s);          return s_check(s);
149  }  }
150    
151    static void
152    setup_brush(BRUSH * out_brush, BRUSH * in_brush)
153    {
154            BRUSHDATA *brush_data;
155            uint8 cache_idx;
156            uint8 colour_code;
157    
158            memcpy(out_brush, in_brush, sizeof(BRUSH));
159            if (out_brush->style & 0x80)
160            {
161                    colour_code = out_brush->style & 0x0f;
162                    cache_idx = out_brush->pattern[0];
163                    brush_data = cache_get_brush_data(colour_code, cache_idx);
164                    if ((brush_data == NULL) || (brush_data->data == NULL))
165                    {
166                            error("error getting brush data, style %x\n", out_brush->style);
167                            out_brush->bd = NULL;
168                            memset(out_brush->pattern, 0, 8);
169                    }
170                    else
171                    {
172                            out_brush->bd = brush_data;
173                    }
174                    out_brush->style = 3;
175            }
176    }
177    
178  /* Parse a brush */  /* Parse a brush */
179  static BOOL  static RD_BOOL
180  rdp_parse_brush(STREAM s, BRUSH * brush, uint32 present)  rdp_parse_brush(STREAM s, BRUSH * brush, uint32 present)
181  {  {
182          if (present & 1)          if (present & 1)
# Line 172  rdp_parse_brush(STREAM s, BRUSH * brush, Line 199  rdp_parse_brush(STREAM s, BRUSH * brush,
199    
200  /* Process a destination blt order */  /* Process a destination blt order */
201  static void  static void
202  process_destblt(STREAM s, DESTBLT_ORDER * os, uint32 present, BOOL delta)  process_destblt(STREAM s, DESTBLT_ORDER * os, uint32 present, RD_BOOL delta)
203  {  {
204          if (present & 0x01)          if (present & 0x01)
205                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 197  process_destblt(STREAM s, DESTBLT_ORDER Line 224  process_destblt(STREAM s, DESTBLT_ORDER
224    
225  /* Process a pattern blt order */  /* Process a pattern blt order */
226  static void  static void
227  process_patblt(STREAM s, PATBLT_ORDER * os, uint32 present, BOOL delta)  process_patblt(STREAM s, PATBLT_ORDER * os, uint32 present, RD_BOOL delta)
228  {  {
229            BRUSH brush;
230    
231          if (present & 0x0001)          if (present & 0x0001)
232                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
233    
# Line 225  process_patblt(STREAM s, PATBLT_ORDER * Line 254  process_patblt(STREAM s, PATBLT_ORDER *
254          DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n", os->opcode, os->x,          DEBUG(("PATBLT(op=0x%x,x=%d,y=%d,cx=%d,cy=%d,bs=%d,bg=0x%x,fg=0x%x)\n", os->opcode, os->x,
255                 os->y, os->cx, os->cy, os->brush.style, os->bgcolour, os->fgcolour));                 os->y, os->cx, os->cy, os->brush.style, os->bgcolour, os->fgcolour));
256    
257            setup_brush(&brush, &os->brush);
258    
259          ui_patblt(ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy,          ui_patblt(ROP2_P(os->opcode), os->x, os->y, os->cx, os->cy,
260                    &os->brush, os->bgcolour, os->fgcolour);                    &brush, os->bgcolour, os->fgcolour);
261  }  }
262    
263  /* Process a screen blt order */  /* Process a screen blt order */
264  static void  static void
265  process_screenblt(STREAM s, SCREENBLT_ORDER * os, uint32 present, BOOL delta)  process_screenblt(STREAM s, SCREENBLT_ORDER * os, uint32 present, RD_BOOL delta)
266  {  {
267          if (present & 0x0001)          if (present & 0x0001)
268                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 262  process_screenblt(STREAM s, SCREENBLT_OR Line 293  process_screenblt(STREAM s, SCREENBLT_OR
293    
294  /* Process a line order */  /* Process a line order */
295  static void  static void
296  process_line(STREAM s, LINE_ORDER * os, uint32 present, BOOL delta)  process_line(STREAM s, LINE_ORDER * os, uint32 present, RD_BOOL delta)
297  {  {
298          if (present & 0x0001)          if (present & 0x0001)
299                  in_uint16_le(s, os->mixmode);                  in_uint16_le(s, os->mixmode);
# Line 301  process_line(STREAM s, LINE_ORDER * os, Line 332  process_line(STREAM s, LINE_ORDER * os,
332    
333  /* Process an opaque rectangle order */  /* Process an opaque rectangle order */
334  static void  static void
335  process_rect(STREAM s, RECT_ORDER * os, uint32 present, BOOL delta)  process_rect(STREAM s, RECT_ORDER * os, uint32 present, RD_BOOL delta)
336  {  {
337          uint32 i;          uint32 i;
338          if (present & 0x01)          if (present & 0x01)
# Line 341  process_rect(STREAM s, RECT_ORDER * os, Line 372  process_rect(STREAM s, RECT_ORDER * os,
372    
373  /* Process a desktop save order */  /* Process a desktop save order */
374  static void  static void
375  process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, BOOL delta)  process_desksave(STREAM s, DESKSAVE_ORDER * os, uint32 present, RD_BOOL delta)
376  {  {
377          int width, height;          int width, height;
378    
# Line 377  process_desksave(STREAM s, DESKSAVE_ORDE Line 408  process_desksave(STREAM s, DESKSAVE_ORDE
408    
409  /* Process a memory blt order */  /* Process a memory blt order */
410  static void  static void
411  process_memblt(STREAM s, MEMBLT_ORDER * os, uint32 present, BOOL delta)  process_memblt(STREAM s, MEMBLT_ORDER * os, uint32 present, RD_BOOL delta)
412  {  {
413          HBITMAP bitmap;          RD_HBITMAP bitmap;
414    
415          if (present & 0x0001)          if (present & 0x0001)
416          {          {
# Line 423  process_memblt(STREAM s, MEMBLT_ORDER * Line 454  process_memblt(STREAM s, MEMBLT_ORDER *
454    
455  /* Process a 3-way blt order */  /* Process a 3-way blt order */
456  static void  static void
457  process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, BOOL delta)  process_triblt(STREAM s, TRIBLT_ORDER * os, uint32 present, RD_BOOL delta)
458  {  {
459          HBITMAP bitmap;          RD_HBITMAP bitmap;
460            BRUSH brush;
461    
462          if (present & 0x000001)          if (present & 0x000001)
463          {          {
# Line 476  process_triblt(STREAM s, TRIBLT_ORDER * Line 508  process_triblt(STREAM s, TRIBLT_ORDER *
508          if (bitmap == NULL)          if (bitmap == NULL)
509                  return;                  return;
510    
511            setup_brush(&brush, &os->brush);
512    
513          ui_triblt(os->opcode, os->x, os->y, os->cx, os->cy,          ui_triblt(os->opcode, os->x, os->y, os->cx, os->cy,
514                    bitmap, os->srcx, os->srcy, &os->brush, os->bgcolour, os->fgcolour);                    bitmap, os->srcx, os->srcy, &brush, os->bgcolour, os->fgcolour);
515  }  }
516    
517  /* Process a polygon order */  /* Process a polygon order */
518  static void  static void
519  process_polygon(STREAM s, POLYGON_ORDER * os, uint32 present, BOOL delta)  process_polygon(STREAM s, POLYGON_ORDER * os, uint32 present, RD_BOOL delta)
520  {  {
521          int index, data, next;          int index, data, next;
522          uint8 flags = 0;          uint8 flags = 0;
523          POINT *points;          RD_POINT *points;
524    
525          if (present & 0x01)          if (present & 0x01)
526                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 528  process_polygon(STREAM s, POLYGON_ORDER Line 562  process_polygon(STREAM s, POLYGON_ORDER
562                  return;                  return;
563          }          }
564    
565          points = (POINT *) xmalloc((os->npoints + 1) * sizeof(POINT));          points = (RD_POINT *) xmalloc((os->npoints + 1) * sizeof(RD_POINT));
566          memset(points, 0, (os->npoints + 1) * sizeof(POINT));          memset(points, 0, (os->npoints + 1) * sizeof(RD_POINT));
567    
568          points[0].x = os->x;          points[0].x = os->x;
569          points[0].y = os->y;          points[0].y = os->y;
# Line 561  process_polygon(STREAM s, POLYGON_ORDER Line 595  process_polygon(STREAM s, POLYGON_ORDER
595    
596  /* Process a polygon2 order */  /* Process a polygon2 order */
597  static void  static void
598  process_polygon2(STREAM s, POLYGON2_ORDER * os, uint32 present, BOOL delta)  process_polygon2(STREAM s, POLYGON2_ORDER * os, uint32 present, RD_BOOL delta)
599  {  {
600          int index, data, next;          int index, data, next;
601          uint8 flags = 0;          uint8 flags = 0;
602          POINT *points;          RD_POINT *points;
603            BRUSH brush;
604    
605          if (present & 0x0001)          if (present & 0x0001)
606                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 613  process_polygon2(STREAM s, POLYGON2_ORDE Line 648  process_polygon2(STREAM s, POLYGON2_ORDE
648                  return;                  return;
649          }          }
650    
651          points = (POINT *) xmalloc((os->npoints + 1) * sizeof(POINT));          setup_brush(&brush, &os->brush);
652          memset(points, 0, (os->npoints + 1) * sizeof(POINT));  
653            points = (RD_POINT *) xmalloc((os->npoints + 1) * sizeof(RD_POINT));
654            memset(points, 0, (os->npoints + 1) * sizeof(RD_POINT));
655    
656          points[0].x = os->x;          points[0].x = os->x;
657          points[0].y = os->y;          points[0].y = os->y;
# Line 637  process_polygon2(STREAM s, POLYGON2_ORDE Line 674  process_polygon2(STREAM s, POLYGON2_ORDE
674    
675          if (next - 1 == os->npoints)          if (next - 1 == os->npoints)
676                  ui_polygon(os->opcode - 1, os->fillmode, points, os->npoints + 1,                  ui_polygon(os->opcode - 1, os->fillmode, points, os->npoints + 1,
677                             &os->brush, os->bgcolour, os->fgcolour);                             &brush, os->bgcolour, os->fgcolour);
678          else          else
679                  error("polygon2 parse error\n");                  error("polygon2 parse error\n");
680    
# Line 646  process_polygon2(STREAM s, POLYGON2_ORDE Line 683  process_polygon2(STREAM s, POLYGON2_ORDE
683    
684  /* Process a polyline order */  /* Process a polyline order */
685  static void  static void
686  process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta)  process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, RD_BOOL delta)
687  {  {
688          int index, next, data;          int index, next, data;
689          uint8 flags = 0;          uint8 flags = 0;
690          PEN pen;          PEN pen;
691          POINT *points;          RD_POINT *points;
692    
693          if (present & 0x01)          if (present & 0x01)
694                  rdp_in_coord(s, &os->x, delta);                  rdp_in_coord(s, &os->x, delta);
# Line 690  process_polyline(STREAM s, POLYLINE_ORDE Line 727  process_polyline(STREAM s, POLYLINE_ORDE
727                  return;                  return;
728          }          }
729    
730          points = (POINT *) xmalloc((os->lines + 1) * sizeof(POINT));          points = (RD_POINT *) xmalloc((os->lines + 1) * sizeof(RD_POINT));
731          memset(points, 0, (os->lines + 1) * sizeof(POINT));          memset(points, 0, (os->lines + 1) * sizeof(RD_POINT));
732    
733          points[0].x = os->x;          points[0].x = os->x;
734          points[0].y = os->y;          points[0].y = os->y;
# Line 724  process_polyline(STREAM s, POLYLINE_ORDE Line 761  process_polyline(STREAM s, POLYLINE_ORDE
761    
762  /* Process an ellipse order */  /* Process an ellipse order */
763  static void  static void
764  process_ellipse(STREAM s, ELLIPSE_ORDER * os, uint32 present, BOOL delta)  process_ellipse(STREAM s, ELLIPSE_ORDER * os, uint32 present, RD_BOOL delta)
765  {  {
766          if (present & 0x01)          if (present & 0x01)
767                  rdp_in_coord(s, &os->left, delta);                  rdp_in_coord(s, &os->left, delta);
# Line 756  process_ellipse(STREAM s, ELLIPSE_ORDER Line 793  process_ellipse(STREAM s, ELLIPSE_ORDER
793    
794  /* Process an ellipse2 order */  /* Process an ellipse2 order */
795  static void  static void
796  process_ellipse2(STREAM s, ELLIPSE2_ORDER * os, uint32 present, BOOL delta)  process_ellipse2(STREAM s, ELLIPSE2_ORDER * os, uint32 present, RD_BOOL delta)
797  {  {
798            BRUSH brush;
799    
800          if (present & 0x0001)          if (present & 0x0001)
801                  rdp_in_coord(s, &os->left, delta);                  rdp_in_coord(s, &os->left, delta);
802    
# Line 788  process_ellipse2(STREAM s, ELLIPSE2_ORDE Line 827  process_ellipse2(STREAM s, ELLIPSE2_ORDE
827                 os->left, os->top, os->right, os->bottom, os->opcode, os->fillmode, os->brush.style,                 os->left, os->top, os->right, os->bottom, os->opcode, os->fillmode, os->brush.style,
828                 os->bgcolour, os->fgcolour));                 os->bgcolour, os->fgcolour));
829    
830            setup_brush(&brush, &os->brush);
831    
832          ui_ellipse(os->opcode - 1, os->fillmode, os->left, os->top, os->right - os->left,          ui_ellipse(os->opcode - 1, os->fillmode, os->left, os->top, os->right - os->left,
833                     os->bottom - os->top, &os->brush, os->bgcolour, os->fgcolour);                     os->bottom - os->top, &brush, os->bgcolour, os->fgcolour);
834  }  }
835    
836  /* Process a text order */  /* Process a text order */
837  static void  static void
838  process_text2(STREAM s, TEXT2_ORDER * os, uint32 present, BOOL delta)  process_text2(STREAM s, TEXT2_ORDER * os, uint32 present, RD_BOOL delta)
839  {  {
840          int i;          int i;
841            BRUSH brush;
842    
843          if (present & 0x000001)          if (present & 0x000001)
844                  in_uint8(s, os->font);                  in_uint8(s, os->font);
# Line 863  process_text2(STREAM s, TEXT2_ORDER * os Line 905  process_text2(STREAM s, TEXT2_ORDER * os
905    
906          DEBUG(("\n"));          DEBUG(("\n"));
907    
908            setup_brush(&brush, &os->brush);
909    
910          ui_draw_text(os->font, os->flags, os->opcode - 1, os->mixmode, os->x, os->y,          ui_draw_text(os->font, os->flags, os->opcode - 1, os->mixmode, os->x, os->y,
911                       os->clipleft, os->cliptop, os->clipright - os->clipleft,                       os->clipleft, os->cliptop, os->clipright - os->clipleft,
912                       os->clipbottom - os->cliptop, os->boxleft, os->boxtop,                       os->clipbottom - os->cliptop, os->boxleft, os->boxtop,
913                       os->boxright - os->boxleft, os->boxbottom - os->boxtop,                       os->boxright - os->boxleft, os->boxbottom - os->boxtop,
914                       &os->brush, os->bgcolour, os->fgcolour, os->text, os->length);                       &brush, os->bgcolour, os->fgcolour, os->text, os->length);
915  }  }
916    
917  /* Process a raw bitmap cache order */  /* Process a raw bitmap cache order */
918  static void  static void
919  process_raw_bmpcache(STREAM s)  process_raw_bmpcache(STREAM s)
920  {  {
921          HBITMAP bitmap;          RD_HBITMAP bitmap;
922          uint16 cache_idx, bufsize;          uint16 cache_idx, bufsize;
923          uint8 cache_id, width, height, bpp, Bpp;          uint8 cache_id, width, height, bpp, Bpp;
924          uint8 *data, *inverted;          uint8 *data, *inverted;
# Line 907  process_raw_bmpcache(STREAM s) Line 951  process_raw_bmpcache(STREAM s)
951  static void  static void
952  process_bmpcache(STREAM s)  process_bmpcache(STREAM s)
953  {  {
954          HBITMAP bitmap;          RD_HBITMAP bitmap;
955          uint16 cache_idx, size;          uint16 cache_idx, size;
956          uint8 cache_id, width, height, bpp, Bpp;          uint8 cache_id, width, height, bpp, Bpp;
957          uint8 *data, *bmpdata;          uint8 *data, *bmpdata;
# Line 961  process_bmpcache(STREAM s) Line 1005  process_bmpcache(STREAM s)
1005    
1006  /* Process a bitmap cache v2 order */  /* Process a bitmap cache v2 order */
1007  static void  static void
1008  process_bmpcache2(STREAM s, uint16 flags, BOOL compressed)  process_bmpcache2(STREAM s, uint16 flags, RD_BOOL compressed)
1009  {  {
1010          HBITMAP bitmap;          RD_HBITMAP bitmap;
1011          int y;          int y;
1012          uint8 cache_id, cache_idx_low, width, height, Bpp;          uint8 cache_id, cache_idx_low, width, height, Bpp;
1013          uint16 cache_idx, bufsize;          uint16 cache_idx, bufsize;
# Line 1045  process_colcache(STREAM s) Line 1089  process_colcache(STREAM s)
1089  {  {
1090          COLOURENTRY *entry;          COLOURENTRY *entry;
1091          COLOURMAP map;          COLOURMAP map;
1092          HCOLOURMAP hmap;          RD_HCOLOURMAP hmap;
1093          uint8 cache_id;          uint8 cache_id;
1094          int i;          int i;
1095    
# Line 1066  process_colcache(STREAM s) Line 1110  process_colcache(STREAM s)
1110          DEBUG(("COLCACHE(id=%d,n=%d)\n", cache_id, map.ncolours));          DEBUG(("COLCACHE(id=%d,n=%d)\n", cache_id, map.ncolours));
1111    
1112          hmap = ui_create_colourmap(&map);          hmap = ui_create_colourmap(&map);
1113          ui_set_colourmap(hmap);  
1114            if (cache_id)
1115                    ui_set_colourmap(hmap);
1116    
1117          xfree(map.colours);          xfree(map.colours);
1118  }  }
# Line 1075  process_colcache(STREAM s) Line 1121  process_colcache(STREAM s)
1121  static void  static void
1122  process_fontcache(STREAM s)  process_fontcache(STREAM s)
1123  {  {
1124          HGLYPH bitmap;          RD_HGLYPH bitmap;
1125          uint8 font, nglyphs;          uint8 font, nglyphs;
1126          uint16 character, offset, baseline, width, height;          uint16 character, offset, baseline, width, height;
1127          int i, datasize;          int i, datasize;
# Line 1102  process_fontcache(STREAM s) Line 1148  process_fontcache(STREAM s)
1148          }          }
1149  }  }
1150    
1151    static void
1152    process_compressed_8x8_brush_data(uint8 * in, uint8 * out, int Bpp)
1153    {
1154            int x, y, pal_index, in_index, shift, do2, i;
1155            uint8 *pal;
1156    
1157            in_index = 0;
1158            pal = in + 16;
1159            /* read it bottom up */
1160            for (y = 7; y >= 0; y--)
1161            {
1162                    /* 2 bytes per row */
1163                    x = 0;
1164                    for (do2 = 0; do2 < 2; do2++)
1165                    {
1166                            /* 4 pixels per byte */
1167                            shift = 6;
1168                            while (shift >= 0)
1169                            {
1170                                    pal_index = (in[in_index] >> shift) & 3;
1171                                    /* size of palette entries depends on Bpp */
1172                                    for (i = 0; i < Bpp; i++)
1173                                    {
1174                                            out[(y * 8 + x) * Bpp + i] = pal[pal_index * Bpp + i];
1175                                    }
1176                                    x++;
1177                                    shift -= 2;
1178                            }
1179                            in_index++;
1180                    }
1181            }
1182    }
1183    
1184    /* Process a brush cache order */
1185    static void
1186    process_brushcache(STREAM s, uint16 flags)
1187    {
1188            BRUSHDATA brush_data;
1189            uint8 cache_idx, colour_code, width, height, size, type;
1190            uint8 *comp_brush;
1191            int index;
1192            int Bpp;
1193    
1194            in_uint8(s, cache_idx);
1195            in_uint8(s, colour_code);
1196            in_uint8(s, width);
1197            in_uint8(s, height);
1198            in_uint8(s, type);      /* type, 0x8x = cached */
1199            in_uint8(s, size);
1200    
1201            DEBUG(("BRUSHCACHE(idx=%d,dp=%d,wd=%d,ht=%d,sz=%d)\n", cache_idx, depth,
1202                   width, height, size));
1203    
1204            if ((width == 8) && (height == 8))
1205            {
1206                    if (colour_code == 1)
1207                    {
1208                            brush_data.colour_code = 1;
1209                            brush_data.data_size = 8;
1210                            brush_data.data = xmalloc(8);
1211                            if (size == 8)
1212                            {
1213                                    /* read it bottom up */
1214                                    for (index = 7; index >= 0; index--)
1215                                    {
1216                                            in_uint8(s, brush_data.data[index]);
1217                                    }
1218                            }
1219                            else
1220                            {
1221                                    warning("incompatible brush, colour_code %d size %d\n", colour_code,
1222                                            size);
1223                            }
1224                            cache_put_brush_data(1, cache_idx, &brush_data);
1225                    }
1226                    else if ((colour_code >= 3) && (colour_code <= 6))
1227                    {
1228                            Bpp = colour_code - 2;
1229                            brush_data.colour_code = colour_code;
1230                            brush_data.data_size = 8 * 8 * Bpp;
1231                            brush_data.data = xmalloc(8 * 8 * Bpp);
1232                            if (size == 16 + 4 * Bpp)
1233                            {
1234                                    in_uint8p(s, comp_brush, 16 + 4 * Bpp);
1235                                    process_compressed_8x8_brush_data(comp_brush, brush_data.data, Bpp);
1236                            }
1237                            else
1238                            {
1239                                    in_uint8a(s, brush_data.data, 8 * 8 * Bpp);
1240                            }
1241                            cache_put_brush_data(colour_code, cache_idx, &brush_data);
1242                    }
1243                    else
1244                    {
1245                            warning("incompatible brush, colour_code %d size %d\n", colour_code, size);
1246                    }
1247            }
1248            else
1249            {
1250                    warning("incompatible brush, width height %d %d\n", width, height);
1251            }
1252    }
1253    
1254  /* Process a secondary order */  /* Process a secondary order */
1255  static void  static void
1256  process_secondary_order(STREAM s)  process_secondary_order(STREAM s)
# Line 1146  process_secondary_order(STREAM s) Line 1295  process_secondary_order(STREAM s)
1295                          process_bmpcache2(s, flags, True);      /* compressed */                          process_bmpcache2(s, flags, True);      /* compressed */
1296                          break;                          break;
1297    
1298                    case RDP_ORDER_BRUSHCACHE:
1299                            process_brushcache(s, flags);
1300                            break;
1301    
1302                  default:                  default:
1303                          unimpl("secondary order %d\n", type);                          unimpl("secondary order %d\n", type);
1304          }          }
# Line 1161  process_orders(STREAM s, uint16 num_orde Line 1314  process_orders(STREAM s, uint16 num_orde
1314          uint32 present;          uint32 present;
1315          uint8 order_flags;          uint8 order_flags;
1316          int size, processed = 0;          int size, processed = 0;
1317          BOOL delta;          RD_BOOL delta;
1318    
1319          while (processed < num_orders)          while (processed < num_orders)
1320          {          {

Legend:
Removed from v.846  
changed lines
  Added in v.1485

  ViewVC Help
Powered by ViewVC 1.1.26