]> git.rm.cloudns.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)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 26 Sep 2010 17:09:38 +0000 (19:09 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10499 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=e8aced660a23cd4ad64764b8ed161a8811262fd3

gl_draw.c

index 212d4ef145ffcd55d41ed68694af27ea70bdc311..6b5c76222ba1ec9d8d902d0569c82804d64ff059 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