From 510a6ab11b854c124f8107e0d237ccc5c7a3acd0 Mon Sep 17 00:00:00 2001 From: lordhavoc Date: Sun, 24 Feb 2002 23:48:19 +0000 Subject: [PATCH] improved internal texture management error messages git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1563 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_textures.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gl_textures.c b/gl_textures.c index 50390ce9..c1682318 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -208,11 +208,14 @@ static void R_FreeTexture(gltexture_t *glt) gltextureimage_t *image, **gltimagepointer; GLuint texnum; + if (glt == NULL) + Host_Error("R_FreeTexture: texture == NULL\n"); + for (gltpointer = &glt->pool->gltchain;*gltpointer && *gltpointer != glt;gltpointer = &(*gltpointer)->chain); if (*gltpointer == glt) *gltpointer = glt->chain; else - Host_Error("R_FreeTexture: texture not linked in pool\n"); + Host_Error("R_FreeTexture: texture \"%s\" not linked in pool\n", glt->identifier); // note: if freeing a fragment texture, this will not make the claimed // space available for new textures unless all other fragments in the @@ -1443,7 +1446,7 @@ rtexture_t *R_ProceduralTexture (rtexturepool_t *rtexturepool, char *identifier, Con_Printf("R_LoadTexture: exact match with existing texture %s\n", identifier); return (rtexture_t *)glt; // exact match, use existing } - Con_DPrintf("R_LoadTexture: cache mismatch, replacing old texture\n"); + Con_Printf("R_LoadTexture: cache mismatch, replacing old texture\n"); R_FreeTexture(glt); } -- 2.39.2