]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix autoload semantics of drawpics
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Sep 2010 16:45:18 +0000 (16:45 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 26 Sep 2010 16:45:18 +0000 (16:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10499 d7cf8633-e32d-0410-b094-e92efae38249

gl_draw.c

index dc25bd0d09acf7f1d65961270e4ebfe48b6ed4ec..5c06e4938416c95d9682e12541bf37075136b967 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -334,7 +334,12 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
                        if(!((pic->texflags ^ texflags) & ~(TEXF_COMPRESS))) // ignore TEXF_COMPRESS when comparing, because fallback pics remove the flag
                        {
                                if(!(cachepicflags & CACHEPICFLAG_NOTPERSISTENT))
-                                       pic->autoload = false; // persist it
+                               {
+                                       if(pic->tex)
+                                               pic->autoload = false; // persist it
+                                       else
+                                               goto reload; // load it below, and then persist
+                               }
                                return pic;
                        }
 
@@ -350,6 +355,7 @@ cachepic_t *Draw_CachePic_Flags(const char *path, unsigned int cachepicflags)
        pic->chain = cachepichash[hashkey];
        cachepichash[hashkey] = pic;
 
+reload:
        // check whether it is an dynamic texture (if so, we can directly use its texture handler)
        pic->tex = CL_GetDynTexture( path );
        // if so, set the width/height, too