*/
qboolean JPEG_OpenLibrary (void)
{
- const char* dllname;
-
- // Already loaded?
- if (jpeg_dll)
- return true;
-
-// TODO: make Sys_LoadLibrary support multiple names
+ const char* dllnames [] =
+ {
#ifdef WIN32
- dllname = "libjpeg.dll";
-#elif defined(__FreeBSD__)
- dllname = "libjpeg.so";
+ "libjpeg.dll",
#elif defined(MACOSX)
- dllname = "libjpeg.62.dylib";
+ "libjpeg.62.dylib",
#else
- dllname = "libjpeg.so.62";
+ "libjpeg.so.62",
+ "libjpeg.so",
#endif
+ NULL
+ };
+
+ // Already loaded?
+ if (jpeg_dll)
+ return true;
// 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;
}
// Open the file
- file = FS_Open (filename, "wb", true);
+ file = FS_Open (filename, "wb", true, false);
if (!file)
return false;