diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2011-09-15 03:32:59 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2011-09-15 03:32:59 +0000 |
commit | 07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2 (patch) | |
tree | 8cd562ac1669a820146dc5cacd1dd5a521272927 /games-strategy/widelands/files | |
parent | Add multilib deps for USE="mp3 scanner" #382125 by Jonathan-Christofer Demay. (diff) | |
download | gentoo-2-07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2.tar.gz gentoo-2-07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2.tar.bz2 gentoo-2-07fbb17e8a0f1f032da2ac3e47fdee2044ee17e2.zip |
Fix building with libpng15 wrt #378181 by Diego Elio Pettenò
(Portage version: 2.2.0_alpha55/cvs/Linux x86_64)
Diffstat (limited to 'games-strategy/widelands/files')
-rw-r--r-- | games-strategy/widelands/files/widelands-0.16-libpng15.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/games-strategy/widelands/files/widelands-0.16-libpng15.patch b/games-strategy/widelands/files/widelands-0.16-libpng15.patch new file mode 100644 index 000000000000..9f733e7b97aa --- /dev/null +++ b/games-strategy/widelands/files/widelands-0.16-libpng15.patch @@ -0,0 +1,61 @@ +--- src/graphic/SDL_mng.cc ++++ src/graphic/SDL_mng.cc +@@ -276,7 +276,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))) { + SDL_SetError("Error reading the PNG file."); + goto done; + } +@@ -356,9 +356,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 const s = (info_ptr->channels == 4) ? 0 : 8; ++ int const s = (png_get_channels(png_ptr, info_ptr) == 4) ? 0 : 8; + Rmask = 0xFF000000 >> s; + Gmask = 0x00FF0000 >> s; + Bmask = 0x0000FF00 >> s; +@@ -369,7 +369,7 @@ + SDL_AllocSurface + (SDL_SWSURFACE, + width, height, +- bit_depth * info_ptr->channels, ++ bit_depth * png_get_channels(png_ptr, info_ptr), + Rmask, Gmask, Bmask, Amask); + if (not surface) { + SDL_SetError("Out of memory"); +@@ -407,6 +407,9 @@ + /* read rest of file, get additional chunks in info_ptr - REQUIRED */ + png_read_end(png_ptr, info_ptr); + ++ png_colorp png_palette; ++ int png_num_palette; ++ + /* Load the palette, if any */ + if ((palette = surface->format->palette)) { + if (color_type == PNG_COLOR_TYPE_GRAY) { +@@ -416,12 +419,12 @@ + palette->colors[i].g = i; + palette->colors[i].b = i; + } +- } else if (info_ptr->num_palette > 0) { +- palette->ncolors = info_ptr->num_palette; +- for (uint32_t 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 (png_num_palette > 0) { ++ palette->ncolors = png_num_palette; ++ for (uint32_t i = 0; i < png_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; + } + } + } |