648 |
static void |
static void |
649 |
process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta) |
process_polyline(STREAM s, POLYLINE_ORDER * os, uint32 present, BOOL delta) |
650 |
{ |
{ |
651 |
int index, line, data; |
int index, next, data; |
|
int x, y, xfrom, yfrom; |
|
652 |
uint8 flags = 0; |
uint8 flags = 0; |
653 |
PEN pen; |
PEN pen; |
654 |
uint8 opcode; |
POINT *points; |
655 |
|
|
656 |
if (present & 0x01) |
if (present & 0x01) |
657 |
rdp_in_coord(s, &os->x, delta); |
rdp_in_coord(s, &os->x, delta); |
690 |
return; |
return; |
691 |
} |
} |
692 |
|
|
693 |
opcode = os->opcode - 1; |
points = (POINT *) xmalloc((os->lines + 1) * sizeof(POINT)); |
694 |
x = os->x; |
memset(points, 0, (os->lines + 1) * sizeof(POINT)); |
695 |
y = os->y; |
|
696 |
pen.style = pen.width = 0; |
points[0].x = os->x; |
697 |
pen.colour = os->fgcolour; |
points[0].y = os->y; |
698 |
|
|
699 |
index = 0; |
index = 0; |
700 |
data = ((os->lines - 1) / 4) + 1; |
data = ((os->lines - 1) / 4) + 1; |
701 |
for (line = 0; (line < os->lines) && (data < os->datasize); line++) |
for (next = 1; (next < os->lines) && (data < os->datasize); next++) |
702 |
{ |
{ |
703 |
xfrom = x; |
if ((next - 1) % 4 == 0) |
|
yfrom = y; |
|
|
|
|
|
if (line % 4 == 0) |
|
704 |
flags = os->data[index++]; |
flags = os->data[index++]; |
705 |
|
|
706 |
if ((flags & 0xc0) == 0) |
if (~flags & 0x80) |
707 |
flags |= 0xc0; /* none = both */ |
points[next].x = parse_delta(os->data, &data); |
|
|
|
|
if (flags & 0x40) |
|
|
x += parse_delta(os->data, &data); |
|
708 |
|
|
709 |
if (flags & 0x80) |
if (~flags & 0x40) |
710 |
y += parse_delta(os->data, &data); |
points[next].y = parse_delta(os->data, &data); |
|
|
|
|
ui_line(opcode, xfrom, yfrom, x, y, &pen); |
|
711 |
|
|
712 |
flags <<= 2; |
flags <<= 2; |
713 |
} |
} |
714 |
|
|
715 |
|
if (next - 1 == os->lines) |
716 |
|
ui_polyline(os->opcode - 1, points, os->lines + 1, &pen); |
717 |
|
else |
718 |
|
error("polyline parse error\n"); |
719 |
} |
} |
720 |
|
|
721 |
/* Process an ellipse order */ |
/* Process an ellipse order */ |