From ca0df4c7ef7fb0b2da0a14175a7d6cbbb6ee4e08 Mon Sep 17 00:00:00 2001 From: bapt Date: Thu, 25 Dec 2014 11:10:44 +0000 Subject: Properly support png 1.5 --- games/fteqw/files/patch-client__image.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/games/fteqw/files/patch-client__image.c b/games/fteqw/files/patch-client__image.c index 6089290..eafe184 100644 --- a/games/fteqw/files/patch-client__image.c +++ b/games/fteqw/files/patch-client__image.c @@ -1,15 +1,23 @@ ---- client/image.c.orig 2012-05-26 14:26:41.000000000 +0200 -+++ client/image.c 2012-05-26 14:27:18.000000000 +0200 -@@ -551,6 +551,8 @@ +--- client/image.c.orig 2014-12-25 11:05:11 UTC ++++ client/image.c +@@ -551,6 +551,7 @@ return NULL; #pragma comment(lib, "../libs/libpng.lib") #else #include -+ #include + #include #endif #endif -@@ -610,7 +612,7 @@ +@@ -573,7 +574,7 @@ void PNGAPI png_default_read_data(png_st + + void VARGS readpngdata(png_structp png_ptr,png_bytep data,png_size_t len) + { +- pngreadinfo_t *ri = (pngreadinfo_t*)png_ptr->io_ptr; ++ pngreadinfo_t *ri = (pngreadinfo_t*)png_get_io_ptr(png_ptr); + if (ri->readposition+len > ri->filelen) + { + png_error(png_ptr, "unexpected eof"); +@@ -610,7 +611,7 @@ qbyte *ReadPNGFile(qbyte *buf, int lengt return (png_rgba = NULL); } @@ -18,7 +26,7 @@ { error: if (data) -@@ -636,7 +638,7 @@ +@@ -636,7 +637,7 @@ error: } if (colortype == PNG_COLOR_TYPE_GRAY && bitdepth < 8) @@ -27,7 +35,7 @@ if (png_get_valid( png, pnginfo, PNG_INFO_tRNS )) png_set_tRNS_to_alpha(png); -@@ -712,7 +714,7 @@ +@@ -712,7 +713,7 @@ int Image_WritePNG (char *filename, int return false; } @@ -36,7 +44,7 @@ png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); return false; -@@ -879,7 +881,7 @@ +@@ -879,7 +880,7 @@ term_source (j_decompress_ptr cinfo) #define GLOBAL(x) x GLOBAL(void) @@ -45,7 +53,7 @@ { my_source_mgr *src; -@@ -945,7 +947,7 @@ +@@ -945,7 +946,7 @@ badjpeg: } jpeg_create_decompress(&cinfo); @@ -54,7 +62,7 @@ (void) jpeg_read_header(&cinfo, TRUE); -@@ -1041,7 +1043,7 @@ +@@ -1041,7 +1042,7 @@ METHODDEF(void) term_destination (j_comp dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; } @@ -63,7 +71,7 @@ { my_destination_mgr *dest; -@@ -1101,7 +1103,7 @@ +@@ -1101,7 +1102,7 @@ void screenshotJPEG(char *filename, int buffer = screendata; -- cgit v1.1