From abb9822935ff7f051ee22b8b17ea6f30529702f9 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 7 Nov 2010 12:37:22 +0000 Subject: [PATCH] Work with libpng 1.4+ too, if we're compiled that way. git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3631 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/image.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/engine/client/image.c b/engine/client/image.c index f8de556f6..740cf015a 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -553,7 +553,11 @@ return NULL; #endif #ifdef _MSC_VER - #pragma comment(lib, MSVCLIBSPATH "libpng.lib") + #ifdef _WIN64 + #pragma comment(lib, MSVCLIBSPATH "libpng64.lib") + #else + #pragma comment(lib, MSVCLIBSPATH "libpng.lib") + #endif #endif @@ -644,7 +648,13 @@ error: } if (colortype == PNG_COLOR_TYPE_GRAY && bitdepth < 8) - png_set_gray_1_2_4_to_8(png); + { + #if PNG_LIBPNG_VER > 10400 + png_set_expand_gray_1_2_4_to_8(png); + #else + png_set_gray_1_2_4_to_8(png); + #endif + } if (png_get_valid( png, pnginfo, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png);