diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2014-12-25 13:46:11 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2014-12-25 13:46:11 +0000 |
commit | 71cd3b0d738c4b8fdbf1a0a944b4ce7d4a66b0fa (patch) | |
tree | c340246734fd7fa8f0534387bf99d48d3f073dbb /games | |
parent | 2468007643f7d6a1de59e1a3ea98ec59f0929c71 (diff) | |
download | ports-71cd3b0d738c4b8fdbf1a0a944b4ce7d4a66b0fa.tar.gz ports-71cd3b0d738c4b8fdbf1a0a944b4ce7d4a66b0fa.zip |
Notes
Diffstat (limited to 'games')
-rw-r--r-- | games/sdlquake2/Makefile | 3 | ||||
-rw-r--r-- | games/sdlquake2/files/patch-gl_image.c | 82 |
2 files changed, 70 insertions, 15 deletions
diff --git a/games/sdlquake2/Makefile b/games/sdlquake2/Makefile index 36f7bb679c1f..7c5e0b8dc046 100644 --- a/games/sdlquake2/Makefile +++ b/games/sdlquake2/Makefile @@ -29,11 +29,10 @@ PLIST_SUB= LIBDIR=${LIBDIR:S/${PREFIX}\///} .include "${.CURDIR}/../quake2-data/Makefile.include" CLIENT_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg \ - libpng15.so:${PORTSDIR}/graphics/png + libpng.so:${PORTSDIR}/graphics/png CLIENT_USE= GL=yes CLIENT_USE= SDL=sdl CLIENT_MAKE_ENV= BUILD_CLIENT=YES -CLIENT_CFLAGS= -I${LOCALBASE}/include/libpng15 DEDICATED_MAKE_ENV= BUILD_DEDICATED=YES diff --git a/games/sdlquake2/files/patch-gl_image.c b/games/sdlquake2/files/patch-gl_image.c index 9b4bbeef3e08..82d14970163f 100644 --- a/games/sdlquake2/files/patch-gl_image.c +++ b/games/sdlquake2/files/patch-gl_image.c @@ -1,14 +1,6 @@ ---- gl_image.c.orig 2005-05-19 22:56:13.000000000 +0200 -+++ gl_image.c 2012-04-29 07:01:09.000000000 +0200 -@@ -20,6 +20,7 @@ - - #include "gl_local.h" - #include <png.h> -+#include <pngpriv.h> - #include <jpeglib.h> - #include "redblack.h" - -@@ -555,7 +556,7 @@ +--- gl_image.c.orig 2005-05-19 20:56:13 UTC ++++ gl_image.c +@@ -555,7 +555,7 @@ typedef struct { size_t Pos; } TPngFileBuffer; @@ -17,7 +9,71 @@ { TPngFileBuffer *PngFileBuffer=(TPngFileBuffer*)png_get_io_ptr(Png); memcpy(buf,PngFileBuffer->Buffer+PngFileBuffer->Pos,size); -@@ -1007,24 +1008,24 @@ +@@ -621,7 +621,7 @@ void LoadPNG (const char *name, byte **p + + png_read_info(png_ptr, info_ptr); + +- if (info_ptr->height > MAX_TEXTURE_DIMENSIONS) ++ if (png_get_image_height(png_ptr, info_ptr) > MAX_TEXTURE_DIMENSIONS) + { + png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); + ri.FS_FreeFile (PngFileBuffer.Buffer); +@@ -629,28 +629,28 @@ void LoadPNG (const char *name, byte **p + return; + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) + { + png_set_palette_to_rgb (png_ptr); + png_set_filler(png_ptr, 0xFF, PNG_FILLER_AFTER); + } + +- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_RGB) + png_set_filler(png_ptr, 0xFF, PNG_FILLER_AFTER); + +- if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY) && info_ptr->bit_depth < 8) ++ if ((png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) && png_get_bit_depth(png_ptr, info_ptr) < 8) + png_set_gray_1_2_4_to_8(png_ptr); + + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) + png_set_tRNS_to_alpha(png_ptr); + +- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY || info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY || png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY_ALPHA) + png_set_gray_to_rgb(png_ptr); + +- if (info_ptr->bit_depth == 16) ++ if (png_get_bit_depth(png_ptr, info_ptr) == 16) + png_set_strip_16(png_ptr); + +- if (info_ptr->bit_depth < 8) ++ if (png_get_bit_depth(png_ptr, info_ptr) < 8) + png_set_packing(png_ptr); + + if (png_get_gAMA(png_ptr, info_ptr, &file_gamma)) +@@ -660,15 +660,15 @@ void LoadPNG (const char *name, byte **p + + rowbytes = png_get_rowbytes(png_ptr, info_ptr); + +- *pic = malloc (info_ptr->height * rowbytes); ++ *pic = malloc (png_get_image_height(png_ptr, info_ptr) * rowbytes); + +- for (i = 0; i < info_ptr->height; i++) ++ for (i = 0; i < png_get_image_height(png_ptr, info_ptr); i++) + row_pointers[i] = *pic + i*rowbytes; + + png_read_image(png_ptr, row_pointers); + +- *width = info_ptr->width; +- *height = info_ptr->height; ++ *width = png_get_image_width(png_ptr, info_ptr); ++ *height = png_get_image_height(png_ptr, info_ptr); + + png_read_end(png_ptr, end_info); + png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); +@@ -1007,24 +1007,24 @@ NiceAss: Code from Q2Ice ================================================================= */ @@ -46,7 +102,7 @@ { cinfo->src = (struct jpeg_source_mgr *)(*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(struct jpeg_source_mgr)); cinfo->src->init_source = jpg_null; -@@ -1065,7 +1066,7 @@ +@@ -1065,7 +1065,7 @@ void LoadJPG (const char *filename, byte cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo); |