From owner-svn-ports-head@FreeBSD.ORG Thu Dec 25 11:03:57 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07D50A11; Thu, 25 Dec 2014 11:03:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A4115B6; Thu, 25 Dec 2014 11:03:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBPB3u3B040488; Thu, 25 Dec 2014 11:03:56 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBPB3u89040486; Thu, 25 Dec 2014 11:03:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412251103.sBPB3u89040486@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 25 Dec 2014 11:03:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r375531 - head/games/egl/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Dec 2014 11:03:57 -0000 Author: bapt Date: Thu Dec 25 11:03:55 2014 New Revision: 375531 URL: https://svnweb.freebsd.org/changeset/ports/375531 QAT: https://qat.redports.org/buildarchive/r375531/ Log: Properly support png 1.5 Modified: head/games/egl/files/patch-renderer__rf_image.c Modified: head/games/egl/files/patch-renderer__rf_image.c ============================================================================== --- head/games/egl/files/patch-renderer__rf_image.c Thu Dec 25 10:49:46 2014 (r375530) +++ head/games/egl/files/patch-renderer__rf_image.c Thu Dec 25 11:03:55 2014 (r375531) @@ -1,14 +1,14 @@ ---- renderer/rf_image.c.orig 2012-04-29 06:34:41.000000000 +0200 -+++ renderer/rf_image.c 2012-04-29 06:35:42.000000000 +0200 -@@ -32,6 +32,7 @@ +--- renderer/rf_image.c.orig 2014-12-25 10:53:09 UTC ++++ renderer/rf_image.c +@@ -32,6 +32,7 @@ Foundation, Inc., 59 Temple Place - Suit #else # include # include -+# include ++# include #endif #define MAX_IMAGE_HASH (MAX_IMAGES/4) -@@ -44,7 +45,7 @@ +@@ -44,7 +45,7 @@ static uint32 *r_imageResampleScratch; image_t *r_lmTextures[R_MAX_LIGHTMAPS]; static image_t r_imageList[MAX_IMAGES]; static image_t *r_imageHashTree[MAX_IMAGE_HASH]; @@ -17,7 +17,7 @@ static byte r_intensityTable[256]; static byte r_gammaTable[256]; -@@ -261,21 +262,6 @@ +@@ -261,21 +262,6 @@ static void jpg_skip_input_data(j_decomp cinfo->src->bytes_in_buffer -= (size_t) num_bytes; } @@ -39,12 +39,76 @@ /* ============= R_LoadJPG -@@ -610,7 +596,7 @@ +@@ -601,46 +587,46 @@ static void R_LoadPNG (char *name, byte + png_read_info (png_ptr, info_ptr); + + // Color +- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) { + png_set_palette_to_rgb (png_ptr); + png_read_update_info (png_ptr, info_ptr); + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB) png_set_filler (png_ptr, 0xFF, PNG_FILLER_AFTER); - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY && info_ptr->bit_depth < 8) +- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY && info_ptr->bit_depth < 8) - png_set_gray_1_2_4_to_8 (png_ptr); ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY && png_get_bit_depth(png_ptr, info_ptr) < 8) + png_set_expand_gray_1_2_4_to_8 (png_ptr); if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha (png_ptr); + +- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY || png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb (png_ptr); + +- if (info_ptr->bit_depth == 16) ++ if (png_get_bit_depth(png_ptr, info_ptr) == 16) + png_set_strip_16 (png_ptr); + +- if (info_ptr->bit_depth < 8) ++ if (png_get_bit_depth(png_ptr, info_ptr) < 8) + png_set_packing (png_ptr); + + png_read_update_info (png_ptr, info_ptr); + + rowbytes = png_get_rowbytes (png_ptr, info_ptr); + +- if (!info_ptr->channels) { ++ if (!png_get_channels(png_ptr, info_ptr)) { + png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); + Com_Printf (PRNT_WARNING, "R_LoadPNG: Bad PNG file: %s\n", name); + FS_FreeFile (PngFileBuffer.buffer); + } + +- pic_ptr = Mem_PoolAllocExt (info_ptr->height * rowbytes, qFalse, ri.imageSysPool, r_imageAllocTag); ++ pic_ptr = Mem_PoolAllocExt (png_get_image_height(png_ptr, info_ptr) * rowbytes, qFalse, ri.imageSysPool, r_imageAllocTag); + if (pic) + *pic = pic_ptr; + +- row_pointers = Mem_PoolAllocExt (sizeof (png_bytep) * info_ptr->height, qFalse, ri.imageSysPool, r_imageAllocTag); ++ row_pointers = Mem_PoolAllocExt (sizeof (png_bytep) * png_get_image_height(png_ptr, info_ptr), qFalse, ri.imageSysPool, r_imageAllocTag); + +- for (i=0 ; iheight ; i++) { ++ for (i=0 ; iwidth; ++ *width = png_get_image_width(png_ptr, info_ptr); + if (height) +- *height = info_ptr->height; ++ *height = png_get_image_height(png_ptr, info_ptr); + if (samples) +- *samples = info_ptr->channels; ++ *samples = png_get_channels(png_ptr, info_ptr); + + png_read_end (png_ptr, end_info); + png_destroy_read_struct (&png_ptr, &info_ptr, &end_info);