Fence textures: also support on world polys. From Fitzquake Mark V

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@972 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2014-08-22 01:10:58 +00:00
parent 342c135a12
commit f292a594b3

View file

@ -368,6 +368,10 @@ void R_DrawTextureChains_Multitexture (void)
if (!bound) //only bind once we are sure we need this texture if (!bound) //only bind once we are sure we need this texture
{ {
GL_Bind ((R_TextureAnimation(t,0))->gltexture); GL_Bind ((R_TextureAnimation(t,0))->gltexture);
if (t->texturechain->flags & SURF_DRAWFENCE)
glEnable (GL_ALPHA_TEST); // Flip alpha test back on
GL_EnableMultitexture(); // selects TEXTURE1 GL_EnableMultitexture(); // selects TEXTURE1
bound = true; bound = true;
} }
@ -385,6 +389,9 @@ void R_DrawTextureChains_Multitexture (void)
rs_brushpasses++; rs_brushpasses++;
} }
GL_DisableMultitexture(); // selects TEXTURE0 GL_DisableMultitexture(); // selects TEXTURE0
if (bound && t->texturechain->flags & SURF_DRAWFENCE)
glDisable (GL_ALPHA_TEST); // Flip alpha test back off
} }
} }
@ -452,12 +459,19 @@ void R_DrawTextureChains_TextureOnly (void)
if (!bound) //only bind once we are sure we need this texture if (!bound) //only bind once we are sure we need this texture
{ {
GL_Bind ((R_TextureAnimation(t,0))->gltexture); GL_Bind ((R_TextureAnimation(t,0))->gltexture);
if (t->texturechain->flags & SURF_DRAWFENCE)
glEnable (GL_ALPHA_TEST); // Flip alpha test back on
bound = true; bound = true;
} }
R_RenderDynamicLightmaps (s); //adds to lightmap chain R_RenderDynamicLightmaps (s); //adds to lightmap chain
DrawGLPoly (s->polys); DrawGLPoly (s->polys);
rs_brushpasses++; rs_brushpasses++;
} }
if (bound && t->texturechain->flags & SURF_DRAWFENCE)
glDisable (GL_ALPHA_TEST); // Flip alpha test back off
} }
} }