const char* dllnames [] =
{
#if WIN32
+ "libpng14-14.dll",
"libpng14.dll",
"libpng12.dll",
#elif defined(MACOSX)
- "libpng14.0.dylib",
+ "libpng14.14.dylib",
"libpng12.0.dylib",
#else
"libpng14.so.14", // WTF libtool guidelines anyone?
} my_png;
//LordHavoc: removed __cdecl prefix, added overrun protection, and rewrote this to be more efficient
-void PNG_fReadData(void *png, unsigned char *data, size_t length)
+static void PNG_fReadData(void *png, unsigned char *data, size_t length)
{
size_t l;
l = my_png.tmpBuflength - my_png.tmpi;
//Com_HexDumpToConsole(data, (int)length);
}
-void PNG_fWriteData(void *png, unsigned char *data, size_t length)
+static void PNG_fWriteData(void *png, unsigned char *data, size_t length)
{
FS_Write(my_png.outfile, data, length);
}
-void PNG_fFlushData(void *png)
+static void PNG_fFlushData(void *png)
{
}
-void PNG_error_fn(void *png, const char *message)
+static void PNG_error_fn(void *png, const char *message)
{
Con_Printf("PNG_LoadImage: error: %s\n", message);
}
-void PNG_warning_fn(void *png, const char *message)
+static void PNG_warning_fn(void *png, const char *message)
{
Con_Printf("PNG_LoadImage: warning: %s\n", message);
}
extern int image_width;
extern int image_height;
-unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize)
+unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize, int *miplevel)
{
unsigned int c;
unsigned int y;
// NOTE: this relies on jmp_buf being the first thing in the png structure
// created by libpng! (this is correct for libpng 1.2.x)
#ifdef __cplusplus
-#if defined(MACOSX) || defined(WIN32)
+#ifdef WIN64
+ if (setjmp((_JBTYPE *)png))
+#elif defined(MACOSX) || defined(WIN32)
if (setjmp((int *)png))
#else
if (setjmp((__jmp_buf_tag *)png))
// NOTE: this relies on jmp_buf being the first thing in the png structure
// created by libpng! (this is correct for libpng 1.2.x)
#ifdef __cplusplus
-#if defined(MACOSX) || defined(WIN32)
+#ifdef WIN64
+ if (setjmp((_JBTYPE *)png))
+#elif defined(MACOSX) || defined(WIN32)
if (setjmp((int *)png))
#else
if (setjmp((__jmp_buf_tag *)png))