43 |
} |
} |
44 |
|
|
45 |
BOOL |
BOOL |
46 |
bitmap_decompress(unsigned char *output, int width, int height, |
bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size) |
|
unsigned char *input, int size) |
|
47 |
{ |
{ |
48 |
unsigned char *end = input + size; |
unsigned char *end = input + size; |
49 |
unsigned char *prevline = NULL, *line = NULL; |
unsigned char *prevline = NULL, *line = NULL; |
113 |
switch (opcode) |
switch (opcode) |
114 |
{ |
{ |
115 |
case 0: /* Fill */ |
case 0: /* Fill */ |
116 |
if ((lastopcode == opcode) |
if ((lastopcode == opcode) && !((x == width) && (prevline == NULL))) |
|
&& !((x == width) && (prevline == NULL))) |
|
117 |
insertmix = True; |
insertmix = True; |
118 |
break; |
break; |
119 |
case 8: /* Bicolour */ |
case 8: /* Bicolour */ |
165 |
if (prevline == NULL) |
if (prevline == NULL) |
166 |
line[x] = mix; |
line[x] = mix; |
167 |
else |
else |
168 |
line[x] = |
line[x] = prevline[x] ^ mix; |
|
prevline[x] ^ |
|
|
mix; |
|
169 |
|
|
170 |
insertmix = False; |
insertmix = False; |
171 |
count--; |
count--; |
189 |
} |
} |
190 |
else |
else |
191 |
{ |
{ |
192 |
REPEAT(line[x] = |
REPEAT(line[x] = prevline[x] ^ mix); |
|
prevline[x] ^ mix); |
|
193 |
} |
} |
194 |
break; |
break; |
195 |
|
|
197 |
if (prevline == NULL) |
if (prevline == NULL) |
198 |
{ |
{ |
199 |
REPEAT(MASK_UPDATE(); |
REPEAT(MASK_UPDATE(); |
200 |
if (mask & mixmask) |
if (mask & mixmask) line[x] = mix; |
|
line[x] = mix; |
|
201 |
else |
else |
202 |
line[x] = 0;); |
line[x] = 0;); |
203 |
} |
} |
205 |
{ |
{ |
206 |
REPEAT(MASK_UPDATE(); |
REPEAT(MASK_UPDATE(); |
207 |
if (mask & mixmask) |
if (mask & mixmask) |
208 |
line[x] = |
line[x] = prevline[x] ^ mix; |
|
prevline[x] ^ mix; |
|
209 |
else |
else |
210 |
line[x] = |
line[x] = prevline[x];); |
|
prevline[x];); |
|
211 |
} |
} |
212 |
break; |
break; |
213 |
|
|
222 |
case 8: /* Bicolour */ |
case 8: /* Bicolour */ |
223 |
REPEAT(if (bicolour) |
REPEAT(if (bicolour) |
224 |
{ |
{ |
225 |
line[x] = colour2; |
line[x] = colour2; bicolour = False;} |
|
bicolour = False;} |
|
226 |
else |
else |
227 |
{ |
{ |
228 |
line[x] = colour1; |
line[x] = colour1; bicolour = True; count++;} |
|
bicolour = True; count++;} |
|
229 |
); |
); |
230 |
break; |
break; |
231 |
|
|
238 |
break; |
break; |
239 |
|
|
240 |
default: |
default: |
241 |
unimpl("bitmap opcode 0x%x\n", |
unimpl("bitmap opcode 0x%x\n", opcode); |
|
opcode); |
|
242 |
return False; |
return False; |
243 |
} |
} |
244 |
} |
} |