]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
image_png: Fix library load order. Fixes broken external textures in some games
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 24 Jul 2020 16:00:52 +0000 (16:00 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 24 Jul 2020 16:00:52 +0000 (16:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12870 d7cf8633-e32d-0410-b094-e92efae38249

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;
 }