]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - image.c
Added a mempool parameter to FS_LoadFile
[xonotic/darkplaces.git] / image.c
diff --git a/image.c b/image.c
index fb553d07d2a0e61ed233814d7341fa0a1ef0cf00..2d3882c9c0cb44c6a17012779df67140aef5b8ba 100644 (file)
--- a/image.c
+++ b/image.c
@@ -655,13 +655,18 @@ qbyte *loadimagepixels (const char *filename, qboolean complain, int matchwidth,
        for (i = 0;imageformats[i].formatstring;i++)
        {
                sprintf (name, imageformats[i].formatstring, basename);
-               if ((f = FS_LoadFile(name, true)) && (data = imageformats[i].loadfunc(f, matchwidth, matchheight)))
+               f = FS_LoadFile(name, tempmempool, true);
+               if (f)
                {
+                       data = imageformats[i].loadfunc(f, matchwidth, matchheight);
                        Mem_Free(f);
-                       Con_DPrintf("loaded image %s (%dx%d)\n", name, image_width, image_height);
-                       if (developer_memorydebug.integer)
-                               Mem_CheckSentinelsGlobal();
-                       return data;
+                       if (data)
+                       {
+                               Con_DPrintf("loaded image %s (%dx%d)\n", name, image_width, image_height);
+                               if (developer_memorydebug.integer)
+                                       Mem_CheckSentinelsGlobal();
+                               return data;
+                       }
                }
        }
        if (complain)