Minor optimization.

This commit is contained in:
Ragnvald Maartmann-Moe IV 2002-06-05 06:46:21 +00:00
parent 0bce2d0f2e
commit 0552d31b0b
2 changed files with 15 additions and 6 deletions

View file

@ -589,7 +589,7 @@ R_DrawAliasModel (entity_t *e, qboolean cull)
else
vo = GL_GetAliasFrameVerts (e->frame, paliashdr, e);
if (modelalpha != 1.0)
if (modelalpha < 1.0)
qfglDepthMask (GL_FALSE);
if (!fb_texture) { // Model has no fullbrights, don't bother with multi
@ -619,7 +619,7 @@ R_DrawAliasModel (entity_t *e, qboolean cull)
}
}
if (modelalpha != 1.0)
if (modelalpha < 1.0)
qfglDepthMask (GL_TRUE);
qfglPopMatrix ();

View file

@ -86,7 +86,7 @@ R_GetSpriteFrame (entity_t *currententity)
void
R_DrawSpriteModel (entity_t *e)
{
float color[4];
float modelalpha, color[4];
float *up, *right;
msprite_t *psprite;
mspriteframe_t *frame;
@ -110,15 +110,21 @@ R_DrawSpriteModel (entity_t *e)
up = vup;
right = vright;
}
VectorScale (up, e->scale, up);
VectorScale (right, e->scale, right);
if (e->scale != 1.0) {
VectorScale (up, e->scale, up);
VectorScale (right, e->scale, right);
}
modelalpha = e->alpha;
if (modelalpha < 1.0)
qfglDepthMask (GL_FALSE);
qfglBindTexture (GL_TEXTURE_2D, frame->gl_texturenum);
qfglBegin (GL_QUADS);
VectorCopy (e->colormod, color);
color[3] = e->alpha;
color[3] = modelalpha;
qfglColor4fv (color);
qfglTexCoord2f (0, 1);
@ -142,4 +148,7 @@ R_DrawSpriteModel (entity_t *e)
qfglVertex3fv (point);
qfglEnd ();
if (modelalpha < 1.0)
qfglDepthMask (GL_TRUE);
}