mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-13 22:30:49 +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(y=0;y<height;y+=2) {
|
||||||
for(x=0;x<width/2;x++) {
|
for(x=0;x<width/2;x++) {
|
||||||
|
|
||||||
/* top color */
|
if (bit_depth==8) {
|
||||||
a2_color=row_pointers[y][x*2];
|
/* top color */
|
||||||
|
a2_color=row_pointers[y][x*2];
|
||||||
|
|
||||||
/* bottom color */
|
/* bottom color */
|
||||||
color=row_pointers[y+1][x*2];
|
color=row_pointers[y+1][x*2];
|
||||||
|
|
||||||
a2_color|=(color<<4);
|
a2_color|=(color<<4);
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("%x ",a2_color);
|
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;
|
/* bottom color */
|
||||||
out_ptr++;
|
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");
|
if (debug) printf("\n");
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ int rle_smaller(int out_type, char *varname,
|
|||||||
fprintf(stdout,"%c",xsize);
|
fprintf(stdout,"%c",xsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
size+=2;
|
size+=1;
|
||||||
|
|
||||||
/* Get first top/bottom color pair */
|
/* Get first top/bottom color pair */
|
||||||
last=image[x];
|
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…
x
Reference in New Issue
Block a user