diff --git a/.gitignore b/.gitignore index d5e8893..b28b2d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *~ *.o src/upiwin +buildutils/mksplash diff --git a/buildutils/Makefile b/buildutils/Makefile index 91c309c..fb1c6ca 100644 --- a/buildutils/Makefile +++ b/buildutils/Makefile @@ -1,7 +1,7 @@ ALL: mksplash mksplash: mksplash.c - gcc -o mksplash -O -Wall -I/usr/include/libpng mksplash.c -lpng12 -lz + gcc -o mksplash -O -Wall -I/usr/include/libpng mksplash.c -lpng16 -lz clean: rm -f *.o mksplash diff --git a/buildutils/mksplash.c b/buildutils/mksplash.c index b32bfb0..62e3edc 100644 --- a/buildutils/mksplash.c +++ b/buildutils/mksplash.c @@ -7,6 +7,10 @@ #include #include +typedef unsigned char uch; +typedef unsigned short ush; +typedef unsigned long ulg; + #ifndef png_jmpbuf #define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf) #endif @@ -152,7 +156,7 @@ uch *readpng_get_image(const char *fname, double display_exponent, int *pChannel return NULL; } - fprintf(stderr, "image %s: chans=%d rowbytes=%ld height=%ld\n", fname, *pChannels, + fprintf(stderr, "image %s: chans=%d rowbytes=%u height=%u\n", fname, *pChannels, rowbytes, height); for (i = 0; i < height; ++i) @@ -189,7 +193,7 @@ int do_convert(const char *infilename, const char *outfilename) ulg image_width, image_height, image_rowbytes, row, i; FILE *fpin; uch *image_data, *src; - uint16_t bred, bgreen, bblue, buf; + uint16_t bred = 0, bgreen = 0, bblue = 0, buf = 0; int image_channels, fdout; uch bg_red=0, bg_green=0, bg_blue=0, br, bg, bb, ba; double display_exponent = 2.2; /* a guesstimate */ @@ -200,7 +204,7 @@ int do_convert(const char *infilename, const char *outfilename) return -1; } - if (readpng_init(fpin, &image_width, &image_height)) + if (readpng_init(infilename, fpin, &image_width, &image_height)) { readpng_cleanup(1); fclose(fpin); @@ -222,7 +226,7 @@ int do_convert(const char *infilename, const char *outfilename) return -1; } - image_data = readpng_get_image(display_exponent, &image_channels, &image_rowbytes); + image_data = readpng_get_image(infilename, display_exponent, &image_channels, &image_rowbytes); readpng_cleanup(0); fclose(fpin); if (!image_data) @@ -266,9 +270,9 @@ int do_convert(const char *infilename, const char *outfilename) } else { - alpha_composite(bred, br, ba, bg_red); - alpha_composite(bgreen, bg, ba, bg_green); - alpha_composite(bblue, bb, ba, bg_blue); + png_composite(bred, br, ba, bg_red); + png_composite(bgreen, bg, ba, bg_green); + png_composite(bblue, bb, ba, bg_blue); } } bred = (bred >> 3) & 0x1F;