GL State leak correction : no more diffuse map disappearance.

git-svn-id: https://svn.eduke32.com/eduke32@461 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
Plagman 2007-01-15 12:17:01 +00:00
parent 581fd77c35
commit 43657d4f56

View file

@ -1623,7 +1623,8 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
detailpth = NULL;
if (r_detailmapping && !r_depthpeeling && indrawroomsandmasks && !drawingskybox && hicfindsubst(globalpicnum, DETAILPAL, 0))
if (r_detailmapping && usehightile && !r_depthpeeling && indrawroomsandmasks && !drawingskybox &&
hicfindsubst(globalpicnum, DETAILPAL, 0))
detailpth = gltexcache(globalpicnum, DETAILPAL,method&(~3));
if (detailpth && (detailpth->hicr->palnum == DETAILPAL))
@ -1886,6 +1887,11 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
}
bglEnd();
}
if (detailpth)
{
bglDisable(GL_TEXTURE_2D);
bglActiveTextureARB(GL_TEXTURE0_ARB);
}
if (fullbrightdrawingpass == 1) // tile has fullbright colors ?
{
fullbrightdrawingpass = 2;
@ -1899,11 +1905,6 @@ void drawpoly (double *dpx, double *dpy, long n, long method)
bglFogf(GL_FOG_DENSITY, fogresult);
fullbrightdrawingpass = 0;
}
if (detailpth)
{
bglDisable(GL_TEXTURE_2D);
bglActiveTextureARB(GL_TEXTURE0_ARB);
}
return;
}
#endif