summaryrefslogtreecommitdiff
path: root/src/common/grfio.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-22 16:08:24 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-22 16:08:24 +0000
commitf65bf4bd28cd9240c889bfd2a1f4650d91760a2d (patch)
tree6730a4d5ca802cc2c4cdb128dca07f1e95cac0fb /src/common/grfio.c
parent6b0b62a5b2a9d85f60afe4fe048403101bd8f39d (diff)
downloadhercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.tar.gz
hercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.tar.bz2
hercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.tar.xz
hercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.zip
* Corrected Spiral Pierce's hits in the skill_db
* Moved /common/*.o into a obj folder when compiling * Updated core and map server to jA 1094~1115 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1162 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/grfio.c')
-rw-r--r--src/common/grfio.c55
1 files changed, 41 insertions, 14 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 0c628d163..224ea909e 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -32,21 +32,36 @@
#include "malloc.h"
#ifdef _WIN32
- #include <windows.h>
- #include "../lib/zlib_win32.h"
- HINSTANCE zlib_dll;
- #define zlib_inflateInit(strm) zlib_inflateInit_((strm),ZLIB_VERSION, sizeof(z_stream))
- #define zlib_deflateInit(strm, level) zlib_deflateInit_((strm),(level),ZLIB_VERSION,sizeof(z_stream))
-
- int (WINAPI* zlib_inflateInit_) (z_streamp strm, const char *version, int stream_size);
- int (WINAPI* zlib_inflate) (z_streamp strm, int flush);
- int (WINAPI* zlib_inflateEnd) (z_streamp strm);
-
- int (WINAPI* zlib_deflateInit_) (z_streamp strm, int level, const char *version, int stream_size);
- int (WINAPI* zlib_deflate) (z_streamp strm, int flush);
- int (WINAPI* zlib_deflateEnd) (z_streamp strm);
+ #ifdef LOCALZLIB
+ #include "../lib/zlib/zlib.h"
+ #define zlib_inflateInit inflateInit
+ #define zlib_inflate inflate
+ #define zlib_inflateEnd inflateEnd
+ #define zlib_deflateInit deflateInit
+ #define zlib_deflate deflate
+ #define zlib_deflateEnd deflateEnd
+ #else
+ #include <windows.h>
+ #include "../lib/zlib_win32.h"
+ HINSTANCE zlib_dll;
+ #define zlib_inflateInit(strm) zlib_inflateInit_((strm),ZLIB_VERSION, sizeof(z_stream))
+ #define zlib_deflateInit(strm, level) zlib_deflateInit_((strm),(level),ZLIB_VERSION,sizeof(z_stream))
+
+ int (WINAPI* zlib_inflateInit_) (z_streamp strm, const char *version, int stream_size);
+ int (WINAPI* zlib_inflate) (z_streamp strm, int flush);
+ int (WINAPI* zlib_inflateEnd) (z_streamp strm);
+
+ int (WINAPI* zlib_deflateInit_) (z_streamp strm, int level, const char *version, int stream_size);
+ int (WINAPI* zlib_deflate) (z_streamp strm, int flush);
+ int (WINAPI* zlib_deflateEnd) (z_streamp strm);
+ #endif
#else
- #include <zlib.h>
+ #ifdef LOCALZLIB
+ #include "zlib/zlib.h"
+ #else
+ #include <zlib.h>
+ #endif
+
#define zlib_inflateInit inflateInit
#define zlib_inflate inflate
#define zlib_inflateEnd inflateEnd
@@ -966,6 +981,16 @@ void grfio_final(void)
}
gentry_table = NULL;
gentry_entrys = gentry_maxentry = 0;
+
+#ifdef _WIN32
+ #ifndef LOCALZLIB
+ FreeLibrary(zlib_dll);
+ zlib_inflateInit_ = NULL;
+ zlib_inflate = NULL;
+ zlib_inflateEnd = NULL;
+ #endif
+#endif
+
}
/*==========================================
@@ -979,6 +1004,7 @@ void grfio_init(char *fname)
int result = 0, result2 = 0, result3 = 0, result4 = 0;
#ifdef _WIN32
+ #ifndef LOCALZLIB
if(!zlib_dll) {
zlib_dll = LoadLibrary("zlib.dll");
(FARPROC)zlib_inflateInit_ = GetProcAddress(zlib_dll,"inflateInit_");
@@ -992,6 +1018,7 @@ void grfio_init(char *fname)
exit(1);
}
}
+ #endif
#endif
data_conf = fopen(fname, "r");