From: divverent Date: Sun, 26 Sep 2010 16:45:18 +0000 (+0000) Subject: fix autoload semantics of drawpics X-Git-Tag: xonotic-v0.1.0preview~155 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=13fc204b90b45f9561fc7b5b54716374a3fb31b2;p=xonotic%2Fdarkplaces.git fix autoload semantics of drawpics git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10499 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=e8aced660a23cd4ad64764b8ed161a8811262fd3 --- diff --git a/gl_draw.c b/gl_draw.c index 212d4ef1..6b5c7622 100644 --- 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