if( !glt->dirtytexnum && glt->flags & GLTEXF_DYNAMIC ) {
glt->dirtytexnum = glt->texnum;
// mark it as dirty, so R_RealGetTexture gets called
- glt->texnum = -1;
+ glt->texnum = 0;
}
}
else
Host_Error("R_FreeTexture: texture \"%s\" not linked in pool", glt->identifier);
- if (glt->texnum > 0)
+ if (!(glt->flags & GLTEXF_UPLOAD))
{
CHECKGLERROR
qglDeleteTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
glt->glformat = texinfo->glformat;
glt->bytesperpixel = texinfo->internalbytesperpixel;
glt->sides = glt->texturetype == GLTEXTURETYPE_CUBEMAP ? 6 : 1;
- glt->texnum = -1;
+ glt->texnum = 0;
// init the dynamic texture attributes, too [11/22/2007 Black]
glt->dirtytexnum = 0;
glt->updatecallback = NULL;