]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
Cleaned up alot more memory leaks. (still get 720 leaks just running demo1.dem)
[xonotic/darkplaces.git] / gl_draw.c
index 336912a1be04020649fb70f95660914bc177dbd0..378bf682e38f0e3660aa550c8ca931b980256729 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -22,6 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include "image.h"
 #include "wad.h"
 
+#include "cl_video.h"
+
 
 static rtexture_t *char_texture;
 
@@ -266,6 +268,14 @@ cachepic_t *Draw_CachePic (char *path)
        cachepic_t *pic;
        qpic_t *p;
 
+       if (!strncmp(CLVIDEOPREFIX, path, sizeof(CLVIDEOPREFIX) - 1)) {
+               clvideo_t *video;
+
+               video = CL_GetVideo(path);
+               if( video )
+                       return &video->cpif;
+       }
+
        crc = CRC_Block(path, strlen(path));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
@@ -308,6 +318,8 @@ cachepic_t  *Draw_CachePic (char *path)
                pic->tex = draw_generateconchars();
        if (pic->tex == NULL && !strcmp(path, "ui/mousepointer.tga"))
                pic->tex = draw_generatemousepointer();
+       if (pic->tex == NULL && !strcmp(path, "gfx/prydoncursor001.tga"))
+               pic->tex = draw_generatemousepointer();
        if (pic->tex == NULL && !strcmp(path, "gfx/crosshair1.tga"))
                pic->tex = draw_generatecrosshair(0);
        if (pic->tex == NULL && !strcmp(path, "gfx/crosshair2.tga"))