[scorched3d] 02/08: Imported Debian patch 43.3.d+dfsg-1.2
Phil Morrell
emorrp1-guest at moszumanska.debian.org
Wed Feb 24 06:10:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
emorrp1-guest pushed a commit to branch master
in repository scorched3d.
commit dde8c1bdb7ba82cf355271ffb2bd9bccbe07763c
Author: Tobias Frost <tobi at debian.org>
Date: Sun Jan 24 14:33:34 2016 +0100
Imported Debian patch 43.3.d+dfsg-1.2
---
debian/changelog | 7 ++++
debian/patches/libpng16.patch | 88 +++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 96 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1a2441d..7cdc2fb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+scorched3d (43.3.d+dfsg-1.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Fix "FTBFS with libpng16" -- adapt to new libpng API (Closes: #809905)
+
+ -- Tobias Frost <tobi at debian.org> Sun, 24 Jan 2016 14:33:34 +0100
+
scorched3d (43.3.d+dfsg-1.1) unstable; urgency=low
* Non-maintainer upload.
diff --git a/debian/patches/libpng16.patch b/debian/patches/libpng16.patch
new file mode 100644
index 0000000..a103377
--- /dev/null
+++ b/debian/patches/libpng16.patch
@@ -0,0 +1,88 @@
+--- scorched3d-43.3.d+dfsg.orig/src/client/client/LoadPNG.cpp
++++ scorched3d-43.3.d+dfsg/src/client/client/LoadPNG.cpp
+@@ -28,6 +28,7 @@ SDL_Surface *EXT_LoadPNG_RW(SDL_RWops *s
+ int row, i;
+ volatile int ckey = -1;
+ png_color_16 *transv;
++ png_byte channels;
+
+ if ( !src ) {
+ /* The error message has been set in SDL_RWFromFile */
+@@ -58,7 +59,7 @@ SDL_Surface *EXT_LoadPNG_RW(SDL_RWops *s
+ * 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;
+ }
+@@ -122,14 +123,17 @@ SDL_Surface *EXT_LoadPNG_RW(SDL_RWops *s
+
+ /* Allocate the SDL surface to hold the image */
+ Rmask = Gmask = Bmask = Amask = 0 ;
++
++ channels = png_get_channels(png_ptr, info_ptr);
++
+ if ( color_type != PNG_COLOR_TYPE_PALETTE ) {
+ if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) {
+ Rmask = 0x000000FF;
+ Gmask = 0x0000FF00;
+ Bmask = 0x00FF0000;
+- Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0;
++ Amask = (channels == 4) ? 0xFF000000 : 0;
+ } else {
+- int s = (info_ptr->channels == 4) ? 0 : 8;
++ int s = (channels == 4) ? 0 : 8;
+ Rmask = 0xFF000000 >> s;
+ Gmask = 0x00FF0000 >> s;
+ Bmask = 0x0000FF00 >> s;
+@@ -137,7 +141,7 @@ SDL_Surface *EXT_LoadPNG_RW(SDL_RWops *s
+ }
+ }
+ surface = SDL_AllocSurface(SDL_SWSURFACE, width, height,
+- bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask);
++ bit_depth*channels, Rmask,Gmask,Bmask,Amask);
+ if ( surface == NULL ) {
+ error = "Out of memory";
+ goto done;
+@@ -178,6 +182,9 @@ SDL_Surface *EXT_LoadPNG_RW(SDL_RWops *s
+ /* Load the palette, if any */
+ palette = surface->format->palette;
+ if ( palette ) {
++ int num_palette;
++ png_colorp png_palette;
++ png_get_PLTE(png_ptr, info_ptr, &png_palette, &num_palette);
+ if(color_type == PNG_COLOR_TYPE_GRAY) {
+ palette->ncolors = 256;
+ for(i = 0; i < 256; i++) {
+@@ -185,12 +192,12 @@ SDL_Surface *EXT_LoadPNG_RW(SDL_RWops *s
+ 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 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;
+ }
+ }
+ }
+--- scorched3d-43.3.d+dfsg.orig/src/common/image/ImagePngFactory.cpp
++++ scorched3d-43.3.d+dfsg/src/common/image/ImagePngFactory.cpp
+@@ -62,7 +62,7 @@ struct user_read_struct
+
+ 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)
diff --git a/debian/patches/series b/debian/patches/series
index db30f2f..1f0e661 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
0006-fix-freetype-includes.patch
0007-spelling.patch
0008-wx3.0-compat.patch
+libpng16.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/scorched3d.git
More information about the Pkg-games-commits
mailing list