22 |
|
|
23 |
#define CVAL(p) (*(p++)) |
#define CVAL(p) (*(p++)) |
24 |
|
|
25 |
uint32 cvalx(unsigned char **input, int Bpp) |
uint32 |
26 |
|
cvalx(unsigned char **input, int Bpp) |
27 |
{ |
{ |
28 |
uint32 rv = 0; |
uint32 rv = 0; |
29 |
memcpy(&rv, *input, Bpp); |
memcpy(&rv, *input, Bpp); |
31 |
return rv; |
return rv; |
32 |
} |
} |
33 |
|
|
34 |
void setli(unsigned char * input, int offset, uint32 value, int Bpp) |
void |
35 |
|
setli(unsigned char *input, int offset, uint32 value, int Bpp) |
36 |
{ |
{ |
37 |
input += offset * Bpp; |
input += offset * Bpp; |
38 |
memcpy(input, &value, Bpp); |
memcpy(input, &value, Bpp); |
39 |
} |
} |
40 |
|
|
41 |
uint32 getli(unsigned char * input, int offset, int Bpp) |
uint32 |
42 |
|
getli(unsigned char *input, int offset, int Bpp) |
43 |
{ |
{ |
44 |
uint32 rv = 0; |
uint32 rv = 0; |
45 |
input += offset * Bpp; |
input += offset * Bpp; |
68 |
} |
} |
69 |
|
|
70 |
BOOL |
BOOL |
71 |
bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size, int Bpp) |
bitmap_decompress(unsigned char *output, int width, int height, unsigned char *input, int size, |
72 |
|
int Bpp) |
73 |
{ |
{ |
74 |
unsigned char *end = input + size; |
unsigned char *end = input + size; |
75 |
unsigned char *prevline = NULL, *line = NULL; |
unsigned char *prevline = NULL, *line = NULL; |
193 |
if (prevline == NULL) |
if (prevline == NULL) |
194 |
setli(line, x, mix, Bpp); |
setli(line, x, mix, Bpp); |
195 |
else |
else |
196 |
setli(line, x, getli(prevline, x, Bpp) ^ mix, Bpp); |
setli(line, x, |
197 |
|
getli(prevline, x, Bpp) ^ mix, Bpp); |
198 |
|
|
199 |
insertmix = False; |
insertmix = False; |
200 |
count--; |
count--; |
203 |
|
|
204 |
if (prevline == NULL) |
if (prevline == NULL) |
205 |
{ |
{ |
206 |
REPEAT(setli(line, x, 0, Bpp)) |
REPEAT(setli(line, x, 0, Bpp))} |
|
} |
|
207 |
else |
else |
208 |
{ |
{ |
209 |
REPEAT(setli(line, x, getli(prevline, x, Bpp), Bpp)); |
REPEAT(setli |
210 |
|
(line, x, getli(prevline, x, Bpp), Bpp)); |
211 |
} |
} |
212 |
break; |
break; |
213 |
|
|
218 |
} |
} |
219 |
else |
else |
220 |
{ |
{ |
221 |
REPEAT(setli(line, x, getli(prevline, x, Bpp) ^ mix, Bpp)); |
REPEAT(setli |
222 |
|
(line, x, getli(prevline, x, Bpp) ^ mix, |
223 |
|
Bpp)); |
224 |
} |
} |
225 |
break; |
break; |
226 |
|
|
236 |
{ |
{ |
237 |
REPEAT(MASK_UPDATE(); |
REPEAT(MASK_UPDATE(); |
238 |
if (mask & mixmask) |
if (mask & mixmask) |
239 |
setli(line, x, getli(prevline, x, Bpp) ^ mix, Bpp); |
setli(line, x, getli(prevline, x, Bpp) ^ mix, |
240 |
|
Bpp); |
241 |
else |
else |
242 |
setli(line, x, getli(prevline, x, Bpp), Bpp);); |
setli(line, x, getli(prevline, x, Bpp), |
243 |
|
Bpp);); |
244 |
} |
} |
245 |
break; |
break; |
246 |
|
|
258 |
setli(line, x, colour2, Bpp); bicolour = False;} |
setli(line, x, colour2, Bpp); bicolour = False;} |
259 |
else |
else |
260 |
{ |
{ |
261 |
setli(line, x, colour1, Bpp); bicolour = True; count++;} |
setli(line, x, colour1, Bpp); bicolour = True; |
262 |
|
count++;} |
263 |
); |
); |
264 |
break; |
break; |
265 |
|
|
280 |
|
|
281 |
return True; |
return True; |
282 |
} |
} |
|
|
|