1 |
/* |
/* |
2 |
rdesktop: A Remote Desktop Protocol client. |
rdesktop: A Remote Desktop Protocol client. |
3 |
Bitmap decompression routines |
Bitmap decompression routines |
4 |
Copyright (C) Matthew Chapman 1999-2002 |
Copyright (C) Matthew Chapman 1999-2005 |
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 |
31 |
#include "rdesktop.h" |
#include "rdesktop.h" |
32 |
|
|
33 |
#define CVAL(p) (*(p++)) |
#define CVAL(p) (*(p++)) |
34 |
#define CVAL2(p) (*(((uint16*)p)++)) /* for 16 bit */ |
#ifdef NEED_ALIGN |
35 |
|
#ifdef L_ENDIAN |
36 |
|
#define CVAL2(p, v) { v = (*(p++)); v |= (*(p++)) << 8; } |
37 |
|
#else |
38 |
|
#define CVAL2(p, v) { v = (*(p++)) << 8; v |= (*(p++)); } |
39 |
|
#endif /* L_ENDIAN */ |
40 |
|
#else |
41 |
|
#define CVAL2(p, v) { v = (*((uint16*)p)); p += 2; } |
42 |
|
#endif /* NEED_ALIGN */ |
43 |
|
|
44 |
#define UNROLL8(exp) { exp exp exp exp exp exp exp exp } |
#define UNROLL8(exp) { exp exp exp exp exp exp exp exp } |
45 |
|
|
338 |
insertmix = True; |
insertmix = True; |
339 |
break; |
break; |
340 |
case 8: /* Bicolour */ |
case 8: /* Bicolour */ |
341 |
colour1 = CVAL2(input); |
CVAL2(input, colour1); |
342 |
case 3: /* Colour */ |
case 3: /* Colour */ |
343 |
colour2 = CVAL2(input); |
CVAL2(input, colour2); |
344 |
break; |
break; |
345 |
case 6: /* SetMix/Mix */ |
case 6: /* SetMix/Mix */ |
346 |
case 7: /* SetMix/FillOrMix */ |
case 7: /* SetMix/FillOrMix */ |
347 |
mix = CVAL2(input); |
CVAL2(input, mix); |
348 |
opcode -= 5; |
opcode -= 5; |
349 |
break; |
break; |
350 |
case 9: /* FillOrMix_1 */ |
case 9: /* FillOrMix_1 */ |
432 |
REPEAT(line[x] = colour2) |
REPEAT(line[x] = colour2) |
433 |
break; |
break; |
434 |
case 4: /* Copy */ |
case 4: /* Copy */ |
435 |
REPEAT(line[x] = CVAL2(input)) |
REPEAT(CVAL2(input, line[x])) |
436 |
break; |
break; |
437 |
case 8: /* Bicolour */ |
case 8: /* Bicolour */ |
438 |
REPEAT |
REPEAT |