glTexEnvf audit.

This commit is contained in:
Zephaniah E. Hull 2000-09-28 06:58:24 +00:00
parent f383faa3c2
commit 0b8cf1e303
8 changed files with 19 additions and 37 deletions

View file

@ -961,7 +961,6 @@ void GL_Set2D (void)
glDisable (GL_CULL_FACE); glDisable (GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor3ubv(lighthalf_v); glColor3ubv(lighthalf_v);
} }

View file

@ -155,7 +155,6 @@ void R_NetGraph (void)
NET_TIMINGS, NET_GRAPHHEIGHT, 0, GL_RGBA, NET_TIMINGS, NET_GRAPHHEIGHT, 0, GL_RGBA,
GL_UNSIGNED_BYTE, ngraph_pixels); GL_UNSIGNED_BYTE, ngraph_pixels);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

View file

@ -522,7 +522,7 @@ void R_DrawParticles (void)
glBindTexture (GL_TEXTURE_2D, particletexture); glBindTexture (GL_TEXTURE_2D, particletexture);
// LordHavoc: particles should not affect zbuffer // LordHavoc: particles should not affect zbuffer
glDepthMask(0); glDepthMask(GL_FALSE);
alphaTestEnabled = glIsEnabled(GL_ALPHA_TEST); alphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
if (alphaTestEnabled) if (alphaTestEnabled)
@ -653,7 +653,7 @@ void R_DrawParticles (void)
glColor3ubv(lighthalf_v); glColor3ubv(lighthalf_v);
if (alphaTestEnabled) if (alphaTestEnabled)
glEnable(GL_ALPHA_TEST); glEnable(GL_ALPHA_TEST);
glDepthMask(1); glDepthMask(GL_TRUE);
} }
/* /*
@ -811,7 +811,7 @@ R_UpdateFires (void)
if (!gl_fires->value) if (!gl_fires->value)
return; return;
glDepthMask (0); glDepthMask(GL_FALSE);
glDisable (GL_TEXTURE_2D); glDisable (GL_TEXTURE_2D);
glShadeModel (GL_SMOOTH); glShadeModel (GL_SMOOTH);
glBlendFunc (GL_ONE, GL_ONE); glBlendFunc (GL_ONE, GL_ONE);
@ -827,7 +827,7 @@ R_UpdateFires (void)
glEnable (GL_TEXTURE_2D); glEnable (GL_TEXTURE_2D);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask (1); glDepthMask(GL_TRUE);
} }
void void

View file

@ -184,7 +184,7 @@ void R_RenderDlights (void)
r_dlightframecount = r_framecount + 1; // because the count hasn't r_dlightframecount = r_framecount + 1; // because the count hasn't
// advanced yet for this frame // advanced yet for this frame
glDepthMask (0); glDepthMask(GL_FALSE);
glDisable (GL_TEXTURE_2D); glDisable (GL_TEXTURE_2D);
glShadeModel (GL_SMOOTH); glShadeModel (GL_SMOOTH);
glBlendFunc (GL_ONE, GL_ONE); glBlendFunc (GL_ONE, GL_ONE);
@ -200,7 +200,7 @@ void R_RenderDlights (void)
glColor3ubv(lighthalf_v); glColor3ubv(lighthalf_v);
glEnable (GL_TEXTURE_2D); glEnable (GL_TEXTURE_2D);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask (1); glDepthMask(GL_TRUE);
} }

View file

@ -379,22 +379,15 @@ static void GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum, qboolean fb)
if (modelalpha != 1.0) if (modelalpha != 1.0)
glDepthMask(0); glDepthMask(0);
while (1) while ((count = *order++)) {
{
// get the vertex count and primitive type // get the vertex count and primitive type
count = *order++; if (count < 0) {
if (!count)
break; // done
if (count < 0)
{
count = -count; count = -count;
glBegin (GL_TRIANGLE_FAN); glBegin (GL_TRIANGLE_FAN);
} } else
else
glBegin (GL_TRIANGLE_STRIP); glBegin (GL_TRIANGLE_STRIP);
do do {
{
// texture coordinates come from the draw list // texture coordinates come from the draw list
glTexCoord2f (((float *)order)[0], ((float *)order)[1]); glTexCoord2f (((float *)order)[0], ((float *)order)[1]);
order += 2; order += 2;
@ -659,10 +652,6 @@ static void R_DrawAliasModel (entity_t *e)
// This block is GL fullbright support for objects... // This block is GL fullbright support for objects...
if (clmodel->hasfullbrights && gl_fb_models->value && if (clmodel->hasfullbrights && gl_fb_models->value &&
paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) { paliashdr->gl_fb_texturenum[currententity->skinnum][anim]) {
/*
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
*/
glBindTexture (GL_TEXTURE_2D, paliashdr->gl_fb_texturenum[currententity->skinnum][anim]); glBindTexture (GL_TEXTURE_2D, paliashdr->gl_fb_texturenum[currententity->skinnum][anim]);
R_SetupAliasFrame (currententity->frame, paliashdr, true); R_SetupAliasFrame (currententity->frame, paliashdr, true);
} }

View file

@ -129,8 +129,6 @@ void R_InitParticleTexture (void)
} }
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
} }
@ -458,7 +456,6 @@ void R_TranslatePlayerSkin (int playernum)
scaled_width, scaled_height, 0, GL_RGBA, scaled_width, scaled_height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, pixels); GL_UNSIGNED_BYTE, pixels);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
} }

View file

@ -474,6 +474,7 @@ dynamic:
fullbright_polys[texture->gl_fb_texturenum] = s->polys; fullbright_polys[texture->gl_fb_texturenum] = s->polys;
} }
glColor3ubv(lighthalf_v); glColor3ubv(lighthalf_v);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
} }
/* /*
@ -487,7 +488,7 @@ void R_BlendLightmaps (void)
glpoly_t *p; glpoly_t *p;
float *v; float *v;
glDepthMask (0); // don't bother writing Z glDepthMask(GL_FALSE); // don't bother writing Z
glBlendFunc (GL_ZERO, GL_SRC_COLOR); glBlendFunc (GL_ZERO, GL_SRC_COLOR);
glColor3f(1,1,1); glColor3f(1,1,1);
@ -520,7 +521,7 @@ void R_BlendLightmaps (void)
glColor3ubv(lighthalf_v); glColor3ubv(lighthalf_v);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask (1); // back to normal Z buffering glDepthMask(GL_TRUE); // back to normal Z buffering
} }
/* /*
@ -634,18 +635,16 @@ dynamic:
void GL_WaterSurface(msurface_t *s) void GL_WaterSurface(msurface_t *s)
{ {
int i; int i;
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
i = s->texinfo->texture->gl_texturenum; i = s->texinfo->texture->gl_texturenum;
glBindTexture (GL_TEXTURE_2D, i); glBindTexture (GL_TEXTURE_2D, i);
if (r_wateralpha->value < 1.0) if (r_wateralpha->value < 1.0)
{ {
glDepthMask(0); glDepthMask(GL_FALSE);
EmitWaterPolys (s); EmitWaterPolys (s);
glDepthMask(1); glDepthMask(GL_TRUE);
} }
else else
EmitWaterPolys (s); EmitWaterPolys (s);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
} }
/* /*
@ -665,9 +664,8 @@ void R_DrawWaterSurfaces (void)
glLoadMatrixf (r_world_matrix); glLoadMatrixf (r_world_matrix);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
if (r_wateralpha->value < 1.0) if (r_wateralpha->value < 1.0)
glDepthMask(0); glDepthMask(GL_FALSE);
i = -1; i = -1;
for (s = waterchain;s;s = s->texturechain) for (s = waterchain;s;s = s->texturechain)
@ -683,7 +681,7 @@ void R_DrawWaterSurfaces (void)
waterchain = NULL; waterchain = NULL;
if (r_wateralpha->value < 1.0) if (r_wateralpha->value < 1.0)
glDepthMask(1); glDepthMask(GL_TRUE);
} }

View file

@ -264,8 +264,8 @@ GL_Init (void)
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); // glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
} }
/* /*