summaryrefslogtreecommitdiff
path: root/community/scorched3d
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-02-06 23:14:50 +0000
committerroot <root@rshg054.dnsready.net>2012-02-06 23:14:50 +0000
commit1fa6edfba8d1e31ca1c0d59e8202cd3c62ccf393 (patch)
tree8d7ccc2dc9d08a4c3cde26aa01c887e9a0fc2fa1 /community/scorched3d
parentbdb5b3e66f6afa586ea147f69af5e4ba388f7615 (diff)
Mon Feb 6 23:14:50 UTC 2012
Diffstat (limited to 'community/scorched3d')
-rw-r--r--community/scorched3d/PKGBUILD5
-rw-r--r--community/scorched3d/scorched3d-libpng1.5.patch74
2 files changed, 78 insertions, 1 deletions
diff --git a/community/scorched3d/PKGBUILD b/community/scorched3d/PKGBUILD
index 42e9f414d..8a481c910 100644
--- a/community/scorched3d/PKGBUILD
+++ b/community/scorched3d/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=scorched3d
pkgver=43.2a
-pkgrel=1
+pkgrel=2
pkgdesc="A 3d artillery combat game"
arch=('i686' 'x86_64')
url="http://www.scorched3d.co.uk/"
@@ -16,12 +16,14 @@ source=("http://downloads.sourceforge.net/${pkgname}/Scorched3D-${pkgver}-src.ta
'scorched3d.png.uu'
'scorched3d-42.1-gcc43.patch'
'scorched3d-42.1-fixups.patch'
+ 'scorched3d-libpng1.5.patch'
'libpng14.patch')
md5sums=('876de173218fd83a2b0a30255ba694fa'
'b951f2150004e10fdff3e6226f1a3939'
'178a281333006c6a5a92919865c1d7af'
'053769f77a38c252eef1d967b18e93e6'
'dfde556559d95bca07c4a390c60790b4'
+ 'ec6958191751b5a2c44aa15abfc75269'
'c8c03855fd3693122fd39427fa3638c1')
build() {
@@ -29,6 +31,7 @@ build() {
# patch -Np1 -i ${srcdir}/scorched3d-42.1-gcc43.patch
patch -Np1 -i ${srcdir}/scorched3d-42.1-fixups.patch
+ patch -Np1 -i ${srcdir}/scorched3d-libpng1.5.patch
# patch -Np0 -i ${srcdir}/libpng14.patch
WANT_WXGTK=gtk2
diff --git a/community/scorched3d/scorched3d-libpng1.5.patch b/community/scorched3d/scorched3d-libpng1.5.patch
new file mode 100644
index 000000000..4e8f003b8
--- /dev/null
+++ b/community/scorched3d/scorched3d-libpng1.5.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;
++ }
+ }
+ }
+ }