]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - jpeg.c
cl_capturevideo_raw* modes now use O_NONBLOCKING file access for more performance
[xonotic/darkplaces.git] / jpeg.c
diff --git a/jpeg.c b/jpeg.c
index 47f45e9188b3e29a40af80025c2fc36676e4c51a..45a2c32b56040932b2e501eca6bf62d383cf6c83 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
@@ -23,6 +23,7 @@
 
 
 #include "quakedef.h"
+#include "image.h"
 #include "jpeg.h"
 
 
@@ -394,23 +395,25 @@ Try to load the JPEG DLL
 */
 qboolean JPEG_OpenLibrary (void)
 {
-       const char* dllname;
+       const char* dllnames [] =
+       {
+#ifdef WIN32
+               "libjpeg.dll",
+#elif defined(MACOSX)
+               "libjpeg.62.dylib",
+#else
+               "libjpeg.so.62",
+               "libjpeg.so",
+#endif
+               NULL
+       };
 
        // Already loaded?
        if (jpeg_dll)
                return true;
 
-// TODO: make Sys_LoadLibrary support multiple names
-#ifdef WIN32
-       dllname = "libjpeg.dll";
-#elif defined(__FreeBSD__)
-       dllname = "libjpeg.so";
-#else
-       dllname = "libjpeg.so.62";
-#endif
-
        // Load the DLL
-       if (! Sys_LoadLibrary (dllname, &jpeg_dll, jpegfuncs))
+       if (! Sys_LoadLibrary (dllnames, &jpeg_dll, jpegfuncs))
        {
                Con_Printf ("JPEG support disabled\n");
                return false;
@@ -668,7 +671,7 @@ qboolean JPEG_SaveImage_preflipped (const char *filename, int width, int height,
        }
 
        // Open the file
-       file = FS_Open (filename, "wb", true);
+       file = FS_Open (filename, "wb", true, false);
        if (!file)
                return false;