]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image_png.c
image_png: Fix library load order. Fixes broken external textures in some games
[xonotic/darkplaces.git] / image_png.c
index 9c712d1556ea3913c87f35e94778e6cad165fab3..7ef74f9a54a1f1445e65246e9cbb0c4b0d32fbd4 100644 (file)
@@ -172,16 +172,14 @@ qboolean PNG_OpenLibrary (void)
                return true;
 
        // Load the DLL
-       if(!Sys_LoadLibrary (dllnames, &png14_dll, pngfuncs))
-       {
-               if(qpng_access_version_number() / 100 >= 104)
-                       return false;
-               if(!Sys_LoadLibrary (dllnames, &png_dll, png14funcs))
+       if(!Sys_LoadLibrary (dllnames, &png_dll, pngfuncs))
+               return false;
+       if(qpng_access_version_number() / 100 >= 104)
+               if(!Sys_LoadLibrary (dllnames, &png14_dll, png14funcs))
                {
-                       Sys_UnloadLibrary (&png14_dll);
+                       Sys_UnloadLibrary (&png_dll);
                        return false;
                }
-       }
        return true;
 }