From abfe9faadc6dfea3aeeacf6d5aa041336bb3263c Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sun, 8 Aug 2004 18:50:44 +0000 Subject: [PATCH] New zlib/libpng libraries This was SVN commit r942. --- source/lib/res/tex.cpp | 14 +++++++++----- source/lib/res/zip.cpp | 13 +++++++++---- source/ps/XML.h | 1 + source/workspaces/required-libraries.txt | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/source/lib/res/tex.cpp b/source/lib/res/tex.cpp index 8481ca384c..9b346e68df 100755 --- a/source/lib/res/tex.cpp +++ b/source/lib/res/tex.cpp @@ -46,9 +46,13 @@ # define _WINDOWS_ // prevent libpng from including windows.h # define WINAPI __stdcall // .. and define what it needs # define WINAPIV __cdecl -# include +# include # ifdef _MSC_VER -# pragma comment(lib, "libpng10.lib") +# ifdef NDEBUG +# pragma comment(lib, "libpng13.lib") +# else +# pragma comment(lib, "libpng13d.lib") +# endif # endif # else // _WIN32 # include @@ -796,7 +800,7 @@ fail: // make sure format is acceptable if(bit_depth != 8) msg = "channel precision != 8 bits"; - if(color_type & 1) + if(color_type & PNG_COLOR_MASK_PALETTE) msg = "color type is invalid (must be direct color)"; if(msg) goto fail; @@ -831,9 +835,9 @@ fail: // shared cleanup ret: -// free(rows); + free(rows); -// png_destroy_read_struct(&png_ptr, &info_ptr, 0); + png_destroy_read_struct(&png_ptr, &info_ptr, 0); return err; } diff --git a/source/lib/res/zip.cpp b/source/lib/res/zip.cpp index 9302da2aa9..85f8c9800e 100755 --- a/source/lib/res/zip.cpp +++ b/source/lib/res/zip.cpp @@ -29,10 +29,15 @@ //#define NO_ZLIB #ifndef NO_ZLIB -#include -#ifdef _MSC_VER -#pragma comment(lib, "zdll.lib") -#endif +# define ZLIB_WINAPI +# include +# ifdef _MSC_VER +# ifdef NDEBUG +# pragma comment(lib, "zlib1.lib") +# else +# pragma comment(lib, "zlib1d.lib") +# endif +# endif #endif #include diff --git a/source/ps/XML.h b/source/ps/XML.h index 9eb4377439..5ab29998e3 100755 --- a/source/ps/XML.h +++ b/source/ps/XML.h @@ -41,6 +41,7 @@ # define new new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif +#define ZLIB_WINAPI #include "zlib.h" // for crc32 #include "res/h_mgr.h" diff --git a/source/workspaces/required-libraries.txt b/source/workspaces/required-libraries.txt index f6a5799105..3dda0a5d83 100755 --- a/source/workspaces/required-libraries.txt +++ b/source/workspaces/required-libraries.txt @@ -25,8 +25,8 @@ Instructions: download http://www.wildfiregames.com/~code/libraries/zlib121.zip. ... extract contents of include/ into $include, and .lib files into $lib. -- libpng (v1.0.15): [PNG texture loading] - download http://www.wildfiregames.com/~code/libraries/libpng10.zip. +- libpng (v1.2.6rc2): [PNG texture loading] + download http://www.wildfiregames.com/~code/libraries/libpng13.zip. ... extract contents of include/ into $include, and .lib files into $lib. - Xerces: [XML parsing for GUI and entity]