]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_textures.c
Add TEXF_PERSISTENT and R_PurgeTexture which only frees textures if that flag isn...
[xonotic/darkplaces.git] / gl_textures.c
index ab6b92478f7e2d2620ce044a00c18955fdb28260..a55660409cd4bb7b702dae60a3f3eee91d009d4d 100644 (file)
@@ -287,6 +287,13 @@ int R_RealGetTexture(rtexture_t *rt)
                return 0;
 }
 
+void R_PurgeTexture(rtexture_t *rt)
+{
+       if(rt && !(((gltexture_t*) rt)->flags & TEXF_PERSISTENT)) {
+               R_FreeTexture(rt);
+       }
+}
+
 void R_FreeTexture(rtexture_t *rt)
 {
        gltexture_t *glt, **gltpointer;