mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-22 04:01:17 +00:00
glTexEnvf audit.
This commit is contained in:
parent
f383faa3c2
commit
0b8cf1e303
8 changed files with 19 additions and 37 deletions
|
@ -961,7 +961,6 @@ void GL_Set2D (void)
|
|||
glDisable (GL_CULL_FACE);
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
glColor3ubv(lighthalf_v);
|
||||
}
|
||||
|
|
|
@ -155,7 +155,6 @@ void R_NetGraph (void)
|
|||
NET_TIMINGS, NET_GRAPHHEIGHT, 0, GL_RGBA,
|
||||
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_MAG_FILTER, GL_LINEAR);
|
||||
|
||||
|
|
|
@ -522,7 +522,7 @@ void R_DrawParticles (void)
|
|||
|
||||
glBindTexture (GL_TEXTURE_2D, particletexture);
|
||||
// LordHavoc: particles should not affect zbuffer
|
||||
glDepthMask(0);
|
||||
glDepthMask(GL_FALSE);
|
||||
alphaTestEnabled = glIsEnabled(GL_ALPHA_TEST);
|
||||
|
||||
if (alphaTestEnabled)
|
||||
|
@ -653,7 +653,7 @@ void R_DrawParticles (void)
|
|||
glColor3ubv(lighthalf_v);
|
||||
if (alphaTestEnabled)
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glDepthMask(1);
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -811,7 +811,7 @@ R_UpdateFires (void)
|
|||
if (!gl_fires->value)
|
||||
return;
|
||||
|
||||
glDepthMask (0);
|
||||
glDepthMask(GL_FALSE);
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glShadeModel (GL_SMOOTH);
|
||||
glBlendFunc (GL_ONE, GL_ONE);
|
||||
|
@ -827,7 +827,7 @@ R_UpdateFires (void)
|
|||
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask (1);
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -184,7 +184,7 @@ void R_RenderDlights (void)
|
|||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
glDepthMask (0);
|
||||
glDepthMask(GL_FALSE);
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glShadeModel (GL_SMOOTH);
|
||||
glBlendFunc (GL_ONE, GL_ONE);
|
||||
|
@ -200,7 +200,7 @@ void R_RenderDlights (void)
|
|||
glColor3ubv(lighthalf_v);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask (1);
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -379,22 +379,15 @@ static void GL_DrawAliasFrame (aliashdr_t *paliashdr, int posenum, qboolean fb)
|
|||
if (modelalpha != 1.0)
|
||||
glDepthMask(0);
|
||||
|
||||
while (1)
|
||||
{
|
||||
while ((count = *order++)) {
|
||||
// get the vertex count and primitive type
|
||||
count = *order++;
|
||||
if (!count)
|
||||
break; // done
|
||||
if (count < 0)
|
||||
{
|
||||
if (count < 0) {
|
||||
count = -count;
|
||||
glBegin (GL_TRIANGLE_FAN);
|
||||
}
|
||||
else
|
||||
} else
|
||||
glBegin (GL_TRIANGLE_STRIP);
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
// texture coordinates come from the draw list
|
||||
glTexCoord2f (((float *)order)[0], ((float *)order)[1]);
|
||||
order += 2;
|
||||
|
@ -659,10 +652,6 @@ static void R_DrawAliasModel (entity_t *e)
|
|||
// This block is GL fullbright support for objects...
|
||||
if (clmodel->hasfullbrights && gl_fb_models->value &&
|
||||
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]);
|
||||
R_SetupAliasFrame (currententity->frame, paliashdr, true);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
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_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
@ -458,7 +456,6 @@ void R_TranslatePlayerSkin (int playernum)
|
|||
scaled_width, scaled_height, 0, GL_RGBA,
|
||||
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_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
|
|
@ -474,6 +474,7 @@ dynamic:
|
|||
fullbright_polys[texture->gl_fb_texturenum] = s->polys;
|
||||
}
|
||||
glColor3ubv(lighthalf_v);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -487,7 +488,7 @@ void R_BlendLightmaps (void)
|
|||
glpoly_t *p;
|
||||
float *v;
|
||||
|
||||
glDepthMask (0); // don't bother writing Z
|
||||
glDepthMask(GL_FALSE); // don't bother writing Z
|
||||
|
||||
glBlendFunc (GL_ZERO, GL_SRC_COLOR);
|
||||
glColor3f(1,1,1);
|
||||
|
@ -520,7 +521,7 @@ void R_BlendLightmaps (void)
|
|||
glColor3ubv(lighthalf_v);
|
||||
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)
|
||||
{
|
||||
int i;
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
i = s->texinfo->texture->gl_texturenum;
|
||||
glBindTexture (GL_TEXTURE_2D, i);
|
||||
if (r_wateralpha->value < 1.0)
|
||||
{
|
||||
glDepthMask(0);
|
||||
glDepthMask(GL_FALSE);
|
||||
EmitWaterPolys (s);
|
||||
glDepthMask(1);
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
else
|
||||
EmitWaterPolys (s);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -665,9 +664,8 @@ void R_DrawWaterSurfaces (void)
|
|||
|
||||
glLoadMatrixf (r_world_matrix);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
if (r_wateralpha->value < 1.0)
|
||||
glDepthMask(0);
|
||||
glDepthMask(GL_FALSE);
|
||||
|
||||
i = -1;
|
||||
for (s = waterchain;s;s = s->texturechain)
|
||||
|
@ -683,7 +681,7 @@ void R_DrawWaterSurfaces (void)
|
|||
waterchain = NULL;
|
||||
|
||||
if (r_wateralpha->value < 1.0)
|
||||
glDepthMask(1);
|
||||
glDepthMask(GL_TRUE);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -264,8 +264,8 @@ GL_Init (void)
|
|||
|
||||
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_REPLACE);
|
||||
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
// glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue