changeset 1633:99be6a1daee1

package sdl_image: simplify patch
author Mark Brand <mabrand@mabrand.nl>
date Sun, 06 Mar 2011 10:40:14 +0100
parents 870ce42b74d3
children 8c1306106205
files src/sdl_image-1-png.patch
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/sdl_image-1-png.patch	Sun Mar 06 17:21:40 2011 +1100
+++ b/src/sdl_image-1-png.patch	Sun Mar 06 10:40:14 2011 +0100
@@ -2,7 +2,7 @@
 See doc/index.html for further information.
 
 diff --git a/IMG_png.c b/IMG_png.c
-index a79fb9c..f85b6c8 100644
+index a79fb9c..67af463 100644
 --- a/IMG_png.c
 +++ b/IMG_png.c
 @@ -80,8 +80,13 @@ static struct {
@@ -73,12 +73,11 @@
  	if ( surface == NULL ) {
  		error = "Out of memory";
  		goto done;
-@@ -466,6 +491,12 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
+@@ -466,6 +491,11 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
  
  	/* Load the palette, if any */
  	palette = surface->format->palette;
 +#if (PNG_LIBPNG_VER >= 10500)
-+	palette = surface->format->palette;
 +	png_colorp info_palette = 0;
 +	int info_num_palette = 0;
 +	png_get_PLTE(png_ptr, info_ptr, &info_palette, &info_num_palette);
@@ -86,7 +85,7 @@
  	if ( palette ) {
  	    if(color_type == PNG_COLOR_TYPE_GRAY) {
  		palette->ncolors = 256;
-@@ -474,12 +505,21 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
+@@ -474,12 +504,21 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
  		    palette->colors[i].g = i;
  		    palette->colors[i].b = i;
  		}