1 |
mr_bones_ 11/12/21 18:46:00 |
2 |
|
3 |
Added: wargus-2.2.5.5-libpng.patch |
4 |
Log: |
5 |
patch to build against newer libpng from jannis (bug #395501) |
6 |
|
7 |
(Portage version: 2.1.10.41/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 games-strategy/wargus/files/wargus-2.2.5.5-libpng.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-strategy/wargus/files/wargus-2.2.5.5-libpng.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-strategy/wargus/files/wargus-2.2.5.5-libpng.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: wargus-2.2.5.5-libpng.patch |
16 |
=================================================================== |
17 |
--- wartool.orig.c |
18 |
+++ wartool.c |
19 |
@@ -61,6 +61,7 @@ |
20 |
#include <unistd.h> |
21 |
#endif |
22 |
#include <ctype.h> |
23 |
+#include <zlib.h> |
24 |
#include <png.h> |
25 |
|
26 |
#include "endian.h" |
27 |
@@ -1876,7 +1877,7 @@ |
28 |
return 1; |
29 |
} |
30 |
|
31 |
- if (setjmp(png_ptr->jmpbuf)) { |
32 |
+ if (setjmp(png_jmpbuf(png_ptr))) { |
33 |
// FIXME: must free buffers!! |
34 |
png_destroy_write_struct(&png_ptr, &info_ptr); |
35 |
fclose(fp); |
36 |
@@ -1888,14 +1889,8 @@ |
37 |
png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); |
38 |
|
39 |
// prepare the file information |
40 |
- info_ptr->width = w; |
41 |
- info_ptr->height = h; |
42 |
- info_ptr->bit_depth = 8; |
43 |
- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; |
44 |
- info_ptr->interlace_type = 0; |
45 |
- info_ptr->valid |= PNG_INFO_PLTE; |
46 |
- info_ptr->palette = (png_colorp)pal; |
47 |
- info_ptr->num_palette = 256; |
48 |
+ png_set_IHDR(png_ptr, info_ptr, w, h, 8, PNG_COLOR_TYPE_PALETTE, 0, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); |
49 |
+ png_set_PLTE(png_ptr, info_ptr, (png_colorp)pal, 256); |
50 |
|
51 |
if (transparent) { |
52 |
unsigned char* p; |