mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-04-22 03:00:47 +00:00
gl_texmgr.c: fix GL_DeleteTexture not clearing deleted textures out of our currently-bound-texture cache for all TMU's
Fixes a bug where if you do "map e1m6" then "kill", the fullbright part of the key texture is missing (drawn in black) - this bug was introduced in 0.90.0. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1168 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
2e67519fc5
commit
ea65ff0c6d
1 changed files with 5 additions and 6 deletions
|
@ -1496,18 +1496,17 @@ void GL_Bind (gltexture_t *texture)
|
|||
================
|
||||
GL_DeleteTexture -- ericw
|
||||
|
||||
Wrapper around glDeleteTextures that also updates our cached current texture
|
||||
binding, if necessary.
|
||||
Wrapper around glDeleteTextures that also clears the given texture number
|
||||
from our per-TMU cached texture binding table.
|
||||
================
|
||||
*/
|
||||
static void GL_DeleteTexture (gltexture_t *texture)
|
||||
{
|
||||
glDeleteTextures (1, &texture->texnum);
|
||||
|
||||
if (texture->texnum == currenttexture[currenttarget - GL_TEXTURE0_ARB])
|
||||
{
|
||||
currenttexture[currenttarget - GL_TEXTURE0_ARB] = 0;
|
||||
}
|
||||
if (texture->texnum == currenttexture[0]) currenttexture[0] = -1;
|
||||
if (texture->texnum == currenttexture[1]) currenttexture[1] = -1;
|
||||
if (texture->texnum == currenttexture[2]) currenttexture[2] = -1;
|
||||
|
||||
texture->texnum = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue