]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
every malloc/calloc/free converted to qmalloc/qfree with tracking (memstats command...
[xonotic/darkplaces.git] / gl_draw.c
index bad2c8c711cfe2db24a1a25a11e985f59a88b4c3..8b0a43783c17af66c68a224457207ee79a80732a 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -209,7 +209,7 @@ qpic_t      *Draw_CachePic (char *path)
 //
 // load the pic from disk
 //
-       dat = (qpic_t *)COM_LoadTempFile (path, false);
+       dat = (qpic_t *)COM_LoadMallocFile (path, false);
        if (!dat)
                Sys_Error ("Draw_CachePic: failed to load %s", path);
        SwapPic (dat);
@@ -232,6 +232,8 @@ qpic_t      *Draw_CachePic (char *path)
        gl->tl = 0;
        gl->th = 1;
 
+       qfree(dat);
+
        return &pic->pic;
 }
 
@@ -484,12 +486,12 @@ void Draw_PicTranslate (int x, int y, qpic_t *pic, byte *translation)
 
        c = pic->width * pic->height;
        src = menuplyr_pixels;
-       dest = trans = malloc(c);
+       dest = trans = qmalloc(c);
        for (i = 0;i < c;i++)
                *dest++ = translation[*src++];
 
        c = GL_LoadTexture ("translatedplayerpic", pic->width, pic->height, trans, false, true, 1);
-       free(trans);
+       qfree(trans);
 
        if (!r_render.value)
                return;