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.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-10-02 01:48:51 +00:00
parent 63ac10dfde
commit 5e6f77cddb

View file

@ -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