26#define BITMAP_SPEED_OVER_SIZE
33#define CVAL(p) (*(p++))
36#define CVAL2(p, v) { v = (*(p++)); v |= (*(p++)) << 8; }
38#define CVAL2(p, v) { v = (*(p++)) << 8; v |= (*(p++)); }
41#define CVAL2(p, v) { v = (*((uint16*)p)); p += 2; }
44#define UNROLL8(exp) { exp exp exp exp exp exp exp exp }
46#define REPEAT(statement) \
48 while((count & ~0x7) && ((x+8) < width)) \
49 UNROLL8( statement; count--; x++; ); \
51 while((count > 0) && (x < width)) \
59#define MASK_UPDATE() \
64 mask = fom_mask ? fom_mask : CVAL(input); \
69#ifdef BITMAP_SPEED_OVER_SIZE
78 int lastopcode = -1, insertmix =
False, bicolour =
False;
80 uint8 colour1 = 0, colour2 = 0;
117 count = (opcode < 0xb) ? 8 : 1;
130 isfillormix = ((opcode == 2) || (opcode == 7));
138 else if (isfillormix)
147 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
205 if (prevline ==
NULL)
213 if (prevline ==
NULL)
223 if (prevline ==
NULL)
233 if (prevline ==
NULL)
284 unimpl(
"bitmap opcode 0x%x\n", opcode);
299 int lastopcode = -1, insertmix =
False, bicolour =
False;
301 uint16 colour1 = 0, colour2 = 0;
338 count = (opcode < 0xb) ? 8 : 1;
351 isfillormix = ((opcode == 2) || (opcode == 7));
359 else if (isfillormix)
368 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
426 if (prevline ==
NULL)
434 if (prevline ==
NULL)
444 if (prevline ==
NULL)
454 if (prevline ==
NULL)
506 unimpl(
"bitmap opcode 0x%x\n", opcode);
521 int lastopcode = -1, insertmix =
False, bicolour =
False;
523 uint8 colour1[3] = {0, 0, 0}, colour2[3] = {0, 0, 0};
574 isfillormix = ((opcode == 2) || (opcode == 7));
582 else if (isfillormix)
591 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
655 if (prevline ==
NULL)
664 prevline[
x * 3] ^
mix[0];
666 prevline[
x * 3 + 1] ^
mix[1];
668 prevline[
x * 3 + 2] ^
mix[2];
674 if (prevline ==
NULL)
687 line[
x * 3] = prevline[
x * 3];
688 line[
x * 3 + 1] = prevline[
x * 3 + 1];
689 line[
x * 3 + 2] = prevline[
x * 3 + 2];
694 if (prevline ==
NULL)
708 prevline[
x * 3] ^
mix[0];
710 prevline[
x * 3 + 1] ^
mix[1];
712 prevline[
x * 3 + 2] ^
mix[2];
717 if (prevline ==
NULL)
744 prevline[
x * 3] ^
mix [0];
746 prevline[
x * 3 + 1] ^
mix [1];
748 prevline[
x * 3 + 2] ^
mix [2];
765 line[
x * 3] = colour2 [0];
766 line[
x * 3 + 1] = colour2 [1];
767 line[
x * 3 + 2] = colour2 [2];
783 line[
x * 3] = colour2[0];
784 line[
x * 3 + 1] = colour2[1];
785 line[
x * 3 + 2] = colour2[2];
790 line[
x * 3] = colour1[0];
791 line[
x * 3 + 1] = colour1[1];
792 line[
x * 3 + 2] = colour1[2];
802 line[
x * 3 + 1] = 0xff;
803 line[
x * 3 + 2] = 0xff;
815 unimpl(
"bitmap opcode 0x%x\n", opcode);
856 int lastopcode = -1, insertmix =
False, bicolour =
False;
858 uint32 colour1 = 0, colour2 = 0;
897 count = (opcode < 0xb) ? 8 : 1;
912 isfillormix = ((opcode == 2) || (opcode == 7));
921 else if (isfillormix)
931 if ((lastopcode == opcode) && !((
x ==
width) && (prevline ==
NULL)))
935 colour1 = cvalx(&
input, Bpp);
937 colour2 = cvalx(&
input, Bpp);
994 if (prevline ==
NULL)
998 getli(prevline,
x, Bpp) ^
mix, Bpp);
1005 if (prevline ==
NULL)
1011 (
line,
x, getli(prevline,
x, Bpp), Bpp));
1016 if (prevline ==
NULL)
1023 (
line,
x, getli(prevline,
x, Bpp) ^
mix,
1029 if (prevline ==
NULL)
1034 setli(
line,
x, 0, Bpp););
1040 setli(
line,
x, getli(prevline,
x, Bpp) ^
mix,
1043 setli(
line,
x, getli(prevline,
x, Bpp),
1059 setli(
line,
x, colour2, Bpp); bicolour =
False;}
1062 setli(
line,
x, colour1, Bpp); bicolour =
True;
1076 unimpl(
"bitmap opcode 0x%x\n", opcode);
1091#ifdef BITMAP_SPEED_OVER_SIZE
static RD_BOOL bitmap_decompress1(uint8 *output, int width, int height, uint8 *input, int size)
static RD_BOOL bitmap_decompress3(uint8 *output, int width, int height, uint8 *input, int size)
RD_BOOL bitmap_decompress(uint8 *output, int width, int height, uint8 *input, int size, int Bpp)
static RD_BOOL bitmap_decompress2(uint8 *output, int width, int height, uint8 *input, int size)
#define REPEAT(statement)
void unimpl(char *format,...)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLenum GLenum input
#define memcpy(s1, s2, n)
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix