From 5e6f77cddbbbe0ca0cc7ce3250e5d99a3fbd34a7 Mon Sep 17 00:00:00 2001 From: Ragnvald Maartmann-Moe IV Date: Tue, 2 Oct 2001 01:48:51 +0000 Subject: [PATCH] Instead of glEnable/glDisable (GL_ALPHA_TEST) pairs for every sprite rendered, let's do it once for the entire sprite loop. Minor hit when there are no sprites, but 2+ it's a gain. Better worst case, rather than better peak performance. --- libs/video/renderer/gl/gl_rmain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/video/renderer/gl/gl_rmain.c b/libs/video/renderer/gl/gl_rmain.c index ce8f40f17..48b766011 100644 --- a/libs/video/renderer/gl/gl_rmain.c +++ b/libs/video/renderer/gl/gl_rmain.c @@ -202,7 +202,6 @@ R_DrawSpriteModel (entity_t *e) qfglBindTexture (GL_TEXTURE_2D, frame->gl_texturenum); - qfglEnable (GL_ALPHA_TEST); qfglBegin (GL_QUADS); qfglTexCoord2f (0, 1); @@ -226,8 +225,6 @@ R_DrawSpriteModel (entity_t *e) qfglVertex3fv (point); qfglEnd (); - - qfglDisable (GL_ALPHA_TEST); } /* ALIAS MODELS */ @@ -780,6 +777,7 @@ R_DrawEntitiesOnList (void) } qfglColor3ubv (color_white); + qfglEnable (GL_ALPHA_TEST); for (i = 0; i < r_numvisedicts; i++) { if (r_visedicts[i]->model->type != mod_sprite) continue; @@ -788,6 +786,7 @@ R_DrawEntitiesOnList (void) R_DrawSpriteModel (currententity); } + qfglDisable (GL_ALPHA_TEST); } static void