18 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 |
*/ |
*/ |
20 |
|
|
21 |
#include "includes.h" |
#include "rdesktop.h" |
22 |
|
|
23 |
#define CVAL(p) (*(p++)) |
#define CVAL(p) (*(p++)) |
24 |
#define SVAL(p) ((*((p++) + 1) << 8) | CVAL(p)) |
#define SVAL(p) ((*((p++) + 1) << 8) | CVAL(p)) |
30 |
unsigned char *input, int size) |
unsigned char *input, int size) |
31 |
{ |
{ |
32 |
unsigned char *end = input + size; |
unsigned char *end = input + size; |
33 |
unsigned char *prevline, *line = NULL; |
unsigned char *prevline = NULL, *line = NULL; |
34 |
int opcode, count, offset, isfillormix, x = width; |
int opcode, count, offset, isfillormix, x = width; |
35 |
int lastopcode = -1, insertmix = False; |
int lastopcode = -1, insertmix = False, bicolour = False; |
36 |
uint8 code, colour1, colour2, mask, mixmask; |
uint8 code, colour1 = 0, colour2 = 0; |
37 |
uint8 mix = 0xff; |
uint8 mixmask, mask = 0, mix = 0xff; |
38 |
|
|
39 |
while (input < end) |
while (input < end) |
40 |
{ |
{ |
88 |
switch (opcode) |
switch (opcode) |
89 |
{ |
{ |
90 |
case 0: /* Fill */ |
case 0: /* Fill */ |
91 |
if ((lastopcode == opcode) && (x != width)) |
if ((lastopcode == opcode) |
92 |
|
&& !((x == width) && (prevline == NULL))) |
93 |
insertmix = True; |
insertmix = True; |
94 |
break; |
break; |
95 |
case 8: /* Bicolour */ |
case 8: /* Bicolour */ |
178 |
break; |
break; |
179 |
|
|
180 |
case 8: /* Bicolour */ |
case 8: /* Bicolour */ |
181 |
REPEAT(line[x] = colour1; line[++x] = colour2) |
REPEAT( |
182 |
|
if (bicolour) |
183 |
|
{ |
184 |
|
line[x] = colour2; |
185 |
|
bicolour = False; |
186 |
|
} |
187 |
|
else |
188 |
|
{ |
189 |
|
line[x] = colour1; |
190 |
|
bicolour = True; |
191 |
|
count++; |
192 |
|
} |
193 |
|
) |
194 |
break; |
break; |
195 |
|
|
196 |
case 13: /* White */ |
case 13: /* White */ |