Correct OpenGL boolean flags.

This commit is contained in:
Jaime Moreira 2024-06-04 15:10:41 -04:00 committed by Denis Pauk
parent d3bf7368c4
commit 5b44620c0e
5 changed files with 17 additions and 18 deletions

View file

@ -96,7 +96,7 @@ R_RenderDlights(void)
/* because the count hasn't advanced yet for this frame */ /* because the count hasn't advanced yet for this frame */
r_dlightframecount = r_framecount + 1; r_dlightframecount = r_framecount + 1;
glDepthMask(0); glDepthMask(GL_FALSE);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
glShadeModel(GL_SMOOTH); glShadeModel(GL_SMOOTH);
glEnable(GL_BLEND); glEnable(GL_BLEND);
@ -113,7 +113,7 @@ R_RenderDlights(void)
glDisable(GL_BLEND); glDisable(GL_BLEND);
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

@ -369,7 +369,7 @@ R_DrawEntitiesOnList(void)
/* draw transparent entities /* draw transparent entities
we could sort these if it ever we could sort these if it ever
becomes a problem... */ becomes a problem... */
glDepthMask(0); glDepthMask(GL_FALSE);
for (i = 0; i < r_newrefdef.num_entities; i++) for (i = 0; i < r_newrefdef.num_entities; i++)
{ {
@ -413,7 +413,7 @@ R_DrawEntitiesOnList(void)
} }
} }
glDepthMask(1); /* back to writing */ glDepthMask(GL_TRUE); /* back to writing */
} }
void void
@ -510,7 +510,7 @@ R_DrawParticles2(int num_particles, const particle_t particles[],
glDisable(GL_BLEND); glDisable(GL_BLEND);
glColor4f(1, 1, 1, 1); glColor4f(1, 1, 1, 1);
glDepthMask(1); /* back to normal Z buffering */ glDepthMask(GL_TRUE); /* back to normal Z buffering */
R_TexEnv(GL_REPLACE); R_TexEnv(GL_REPLACE);
YQ2_VLAFREE(vtx); YQ2_VLAFREE(vtx);
@ -814,7 +814,7 @@ R_Clear(void)
// Check whether the stencil buffer needs clearing, and do so if need be. // Check whether the stencil buffer needs clearing, and do so if need be.
GLbitfield stencilFlags = 0; GLbitfield stencilFlags = 0;
if (gl_state.stereo_mode >= STEREO_MODE_ROW_INTERLEAVED && gl_state.stereo_mode <= STEREO_MODE_PIXEL_INTERLEAVED) { if (gl_state.stereo_mode >= STEREO_MODE_ROW_INTERLEAVED && gl_state.stereo_mode <= STEREO_MODE_PIXEL_INTERLEAVED) {
glClearStencil(0); glClearStencil(GL_FALSE);
stencilFlags |= GL_STENCIL_BUFFER_BIT; stencilFlags |= GL_STENCIL_BUFFER_BIT;
} }
@ -875,7 +875,7 @@ R_Clear(void)
/* stencilbuffer shadows */ /* stencilbuffer shadows */
if (gl_shadows->value && gl_state.stencil && gl1_stencilshadow->value) if (gl_shadows->value && gl_state.stencil && gl1_stencilshadow->value)
{ {
glClearStencil(1); glClearStencil(GL_TRUE);
glClear(GL_STENCIL_BUFFER_BIT); glClear(GL_STENCIL_BUFFER_BIT);
} }
} }

View file

@ -232,7 +232,7 @@ R_BlendLightmaps(const model_t *currentmodel)
} }
/* don't bother writing Z */ /* don't bother writing Z */
glDepthMask(0); glDepthMask(GL_FALSE);
/* set the appropriate blending mode unless /* set the appropriate blending mode unless
we're only looking at the lightmaps. */ we're only looking at the lightmaps. */
@ -397,7 +397,7 @@ R_BlendLightmaps(const model_t *currentmodel)
/* restore state */ /* restore state */
glDisable(GL_BLEND); glDisable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(1); glDepthMask(GL_TRUE);
} }
static void static void

View file

@ -1124,7 +1124,7 @@ GL3_DrawEntitiesOnList(void)
/* draw transparent entities /* draw transparent entities
we could sort these if it ever we could sort these if it ever
becomes a problem... */ becomes a problem... */
glDepthMask(0); glDepthMask(GL_FALSE);
for (i = 0; i < gl3_newrefdef.num_entities; i++) for (i = 0; i < gl3_newrefdef.num_entities; i++)
{ {
@ -1170,7 +1170,7 @@ GL3_DrawEntitiesOnList(void)
GL3_DrawAliasShadows(); GL3_DrawAliasShadows();
glDepthMask(1); /* back to writing */ glDepthMask(GL_TRUE); /* back to writing */
} }
static void static void
@ -1790,7 +1790,7 @@ GL3_Clear(void)
GLbitfield stencilFlags = 0; GLbitfield stencilFlags = 0;
#if 0 // TODO: stereo stuff #if 0 // TODO: stereo stuff
if (gl3state.stereo_mode >= STEREO_MODE_ROW_INTERLEAVED && gl_state.stereo_mode <= STEREO_MODE_PIXEL_INTERLEAVED) { if (gl3state.stereo_mode >= STEREO_MODE_ROW_INTERLEAVED && gl_state.stereo_mode <= STEREO_MODE_PIXEL_INTERLEAVED) {
glClearStencil(0); glClearStencil(GL_FALSE);
stencilFlags |= GL_STENCIL_BUFFER_BIT; stencilFlags |= GL_STENCIL_BUFFER_BIT;
} }
#endif // 0 #endif // 0
@ -1826,7 +1826,7 @@ GL3_Clear(void)
/* stencilbuffer shadows */ /* stencilbuffer shadows */
if (gl_shadows->value && gl3config.stencil) if (gl_shadows->value && gl3config.stencil)
{ {
glClearStencil(1); glClearStencil(GL_TRUE);
glClear(GL_STENCIL_BUFFER_BIT); glClear(GL_STENCIL_BUFFER_BIT);
} }
} }

View file

@ -1095,7 +1095,7 @@ GL4_DrawEntitiesOnList(void)
/* draw transparent entities /* draw transparent entities
we could sort these if it ever we could sort these if it ever
becomes a problem... */ becomes a problem... */
glDepthMask(0); glDepthMask(GL_FALSE);
for (i = 0; i < gl4_newrefdef.num_entities; i++) for (i = 0; i < gl4_newrefdef.num_entities; i++)
{ {
@ -1141,8 +1141,7 @@ GL4_DrawEntitiesOnList(void)
GL4_DrawAliasShadows(); GL4_DrawAliasShadows();
glDepthMask(1); /* back to writing */ glDepthMask(GL_TRUE); /* back to writing */
} }
static void static void
@ -1757,7 +1756,7 @@ GL4_Clear(void)
GLbitfield stencilFlags = 0; GLbitfield stencilFlags = 0;
#if 0 // TODO: stereo stuff #if 0 // TODO: stereo stuff
if (gl4state.stereo_mode >= STEREO_MODE_ROW_INTERLEAVED && gl_state.stereo_mode <= STEREO_MODE_PIXEL_INTERLEAVED) { if (gl4state.stereo_mode >= STEREO_MODE_ROW_INTERLEAVED && gl_state.stereo_mode <= STEREO_MODE_PIXEL_INTERLEAVED) {
glClearStencil(0); glClearStencil(GL_FALSE);
stencilFlags |= GL_STENCIL_BUFFER_BIT; stencilFlags |= GL_STENCIL_BUFFER_BIT;
} }
#endif // 0 #endif // 0
@ -1793,7 +1792,7 @@ GL4_Clear(void)
/* stencilbuffer shadows */ /* stencilbuffer shadows */
if (gl_shadows->value && gl4config.stencil) if (gl_shadows->value && gl4config.stencil)
{ {
glClearStencil(1); glClearStencil(GL_TRUE);
glClear(GL_STENCIL_BUFFER_BIT); glClear(GL_STENCIL_BUFFER_BIT);
} }
} }