]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image_png.c
added Sys_PrintfToTerminal function for convenience, this replaces
[xonotic/darkplaces.git] / image_png.c
index ed5ed62340593b73534accec5ca117275ac6e3e6..9c03f8f3c05be418a2cd97c36a243281e06d6a2e 100644 (file)
@@ -126,10 +126,11 @@ qboolean PNG_OpenLibrary (void)
        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?
@@ -216,7 +217,7 @@ static struct
 } 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;
@@ -233,21 +234,21 @@ void PNG_fReadData(void *png, unsigned char *data, size_t length)
        //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);
 }
@@ -255,7 +256,7 @@ void PNG_warning_fn(void *png, const char *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;
@@ -285,7 +286,9 @@ unsigned char *PNG_LoadImage_BGRA (const unsigned char *raw, int filesize)
        // 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))
@@ -478,7 +481,9 @@ qboolean PNG_SaveImage_preflipped (const char *filename, int width, int height,
        // 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))