diff options
Diffstat (limited to 'games/wargus/files/patch-wartool.c')
-rw-r--r-- | games/wargus/files/patch-wartool.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/games/wargus/files/patch-wartool.c b/games/wargus/files/patch-wartool.c index 7161df10796a..65ebc12ce8e9 100644 --- a/games/wargus/files/patch-wartool.c +++ b/games/wargus/files/patch-wartool.c @@ -1,15 +1,14 @@ ---- wartool.c.orig 2010-11-22 22:44:24.000000000 +0100 -+++ wartool.c 2012-05-05 12:37:53.000000000 +0200 -@@ -62,6 +62,8 @@ +--- wartool.orig.c ++++ wartool.c +@@ -61,6 +61,7 @@ + #include <unistd.h> #endif #include <ctype.h> - #include <png.h> +#include <zlib.h> -+#include <pngpriv.h> + #include <png.h> #include "endian.h" - #include "xmi2mid.h" -@@ -1876,7 +1878,7 @@ +@@ -1876,7 +1877,7 @@ return 1; } @@ -18,3 +17,20 @@ // FIXME: must free buffers!! png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); +@@ -1888,14 +1889,8 @@ + png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); + + // prepare the file information +- info_ptr->width = w; +- info_ptr->height = h; +- info_ptr->bit_depth = 8; +- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; +- info_ptr->interlace_type = 0; +- info_ptr->valid |= PNG_INFO_PLTE; +- info_ptr->palette = (png_colorp)pal; +- info_ptr->num_palette = 256; ++ png_set_IHDR(png_ptr, info_ptr, w, h, 8, PNG_COLOR_TYPE_PALETTE, 0, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); ++ png_set_PLTE(png_ptr, info_ptr, (png_colorp)pal, 256); + + if (transparent) { + unsigned char* p; |