diff options
author | Alfredo Tupone <tupone@gentoo.org> | 2011-09-12 12:44:05 +0000 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2011-09-12 12:44:05 +0000 |
commit | 476069e53230ebfe1b26dbc924652f07cb43cff5 (patch) | |
tree | 889627458918910f6bea905c1c76607edc2575d7 /games-strategy/scorched3d | |
parent | typo (diff) | |
download | gentoo-2-476069e53230ebfe1b26dbc924652f07cb43cff5.tar.gz gentoo-2-476069e53230ebfe1b26dbc924652f07cb43cff5.tar.bz2 gentoo-2-476069e53230ebfe1b26dbc924652f07cb43cff5.zip |
Build with media-libs/libpng-1.5 Bug #381121
(Portage version: 2.1.10.15/cvs/Linux i686)
Diffstat (limited to 'games-strategy/scorched3d')
-rw-r--r-- | games-strategy/scorched3d/ChangeLog | 6 | ||||
-rw-r--r-- | games-strategy/scorched3d/files/scorched3d-43.2a-png15.patch | 74 |
2 files changed, 79 insertions, 1 deletions
diff --git a/games-strategy/scorched3d/ChangeLog b/games-strategy/scorched3d/ChangeLog index 64e072d5006d..2a1dacaff746 100644 --- a/games-strategy/scorched3d/ChangeLog +++ b/games-strategy/scorched3d/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-strategy/scorched3d # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-strategy/scorched3d/ChangeLog,v 1.81 2011/03/25 12:18:07 xarthisius Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-strategy/scorched3d/ChangeLog,v 1.82 2011/09/12 12:44:05 tupone Exp $ + + 12 Sep 2011; Tupone Alfredo <tupone@gentoo.org> + +files/scorched3d-43.2a-png15.patch: + Build with media-libs/libpng-1.5 Bug #381121 by Diego Elio Pettenò 25 Mar 2011; Kacper Kowalik <xarthisius@gentoo.org> scorched3d-43.2a.ebuild: pp64 stable wrt #350765 diff --git a/games-strategy/scorched3d/files/scorched3d-43.2a-png15.patch b/games-strategy/scorched3d/files/scorched3d-43.2a-png15.patch new file mode 100644 index 000000000000..4e8f003b8dde --- /dev/null +++ b/games-strategy/scorched3d/files/scorched3d-43.2a-png15.patch @@ -0,0 +1,74 @@ +--- ./src/common/image/ImagePngFactory.cpp.old 2011-09-12 12:34:30.114461019 +0200 ++++ ./src/common/image/ImagePngFactory.cpp 2011-09-12 12:39:28.566425593 +0200 +@@ -104,7 +104,7 @@ +
+ static void user_png_error(png_structp png_ptr, png_const_charp msg)
+ {
+- longjmp(png_ptr->jmpbuf,1);
++ longjmp(png_jmpbuf(png_ptr),1);
+ }
+
+ static void user_png_warning(png_structp png_ptr, png_const_charp msg)
+--- ./src/client/client/LoadPNG.cpp.old 2011-09-12 12:45:49.167380419 +0200 ++++ ./src/client/client/LoadPNG.cpp 2011-09-12 14:11:14.961772024 +0200 +@@ -28,6 +28,8 @@ + int row, i; + volatile int ckey = -1; + png_color_16 *transv; ++ png_colorp png_palette; ++ int num_palette; + + if ( !src ) { + /* The error message has been set in SDL_RWFromFile */ +@@ -58,7 +60,7 @@ + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in png_create_read_struct() earlier. + */ +- if ( setjmp(png_ptr->jmpbuf) ) { ++ if ( setjmp(png_jmpbuf(png_ptr)) ) { + error = "Error reading the PNG file."; + goto done; + } +@@ -127,9 +129,9 @@ + Rmask = 0x000000FF; + Gmask = 0x0000FF00; + Bmask = 0x00FF0000; +- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; ++ Amask = (png_get_channels(png_ptr, info_ptr) == 4) ? 0xFF000000 : 0; + } else { +- int s = (info_ptr->channels == 4) ? 0 : 8; ++ int s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8; + Rmask = 0xFF000000 >> s; + Gmask = 0x00FF0000 >> s; + Bmask = 0x0000FF00 >> s; +@@ -137,7 +139,7 @@ + } + } + surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, +- bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask); ++ bit_depth*png_get_channels(png_ptr, info_ptr), Rmask,Gmask,Bmask,Amask); + if ( surface == NULL ) { + error = "Out of memory"; + goto done; +@@ -185,12 +187,15 @@ + palette->colors[i].g = i; + palette->colors[i].b = i; + } +- } else if (info_ptr->num_palette > 0 ) { +- palette->ncolors = info_ptr->num_palette; +- for( i=0; i<info_ptr->num_palette; ++i ) { +- palette->colors[i].b = info_ptr->palette[i].blue; +- palette->colors[i].g = info_ptr->palette[i].green; +- palette->colors[i].r = info_ptr->palette[i].red; ++ } else { ++ png_get_PLTE(png_ptr, info_ptr, &png_palette, &num_palette); ++ if (num_palette > 0 ) { ++ palette->ncolors = num_palette; ++ for( i=0; i<num_palette; ++i ) { ++ palette->colors[i].b = png_palette[i].blue; ++ palette->colors[i].g = png_palette[i].green; ++ palette->colors[i].r = png_palette[i].red; ++ } + } + } + } |