mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-12-27 02:31:00 +00:00
png2rle: handle 4-bit depth png files
should make a warning I suppose
This commit is contained in:
parent
5af4f268d0
commit
44f183b72a
@ -166,20 +166,39 @@ int loadpng(char *filename, unsigned char **image_ptr, int *xsize, int *ysize) {
|
||||
for(y=0;y<height;y+=2) {
|
||||
for(x=0;x<width/2;x++) {
|
||||
|
||||
/* top color */
|
||||
a2_color=row_pointers[y][x*2];
|
||||
if (bit_depth==8) {
|
||||
/* top color */
|
||||
a2_color=row_pointers[y][x*2];
|
||||
|
||||
/* bottom color */
|
||||
color=row_pointers[y+1][x*2];
|
||||
/* bottom color */
|
||||
color=row_pointers[y+1][x*2];
|
||||
|
||||
a2_color|=(color<<4);
|
||||
a2_color|=(color<<4);
|
||||
|
||||
if (debug) {
|
||||
printf("%x ",a2_color);
|
||||
if (debug) {
|
||||
printf("%x ",a2_color);
|
||||
}
|
||||
|
||||
*out_ptr=a2_color;
|
||||
out_ptr++;
|
||||
}
|
||||
else if (bit_depth==4) {
|
||||
/* top color */
|
||||
a2_color=row_pointers[y][x];
|
||||
|
||||
*out_ptr=a2_color;
|
||||
out_ptr++;
|
||||
/* bottom color */
|
||||
color=row_pointers[y+1][x];
|
||||
|
||||
a2_color|=(color<<4);
|
||||
|
||||
if (debug) {
|
||||
printf("%x ",a2_color);
|
||||
}
|
||||
|
||||
*out_ptr=a2_color;
|
||||
out_ptr++;
|
||||
|
||||
}
|
||||
}
|
||||
if (debug) printf("\n");
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ int rle_smaller(int out_type, char *varname,
|
||||
fprintf(stdout,"%c",xsize);
|
||||
}
|
||||
|
||||
size+=2;
|
||||
size+=1;
|
||||
|
||||
/* Get first top/bottom color pair */
|
||||
last=image[x];
|
||||
|
BIN
ootw/ootw_graphics/l2jail/dome.png
Normal file
BIN
ootw/ootw_graphics/l2jail/dome.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 328 B |
Loading…
Reference in New Issue
Block a user