mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-29 20:20:43 +00:00
Fix failure to free cache for non-shadowed stuff (lightning, grenades, etc).
Also a minor speedup (only mess with glHints once per frame, instead of dozens of times).
This commit is contained in:
parent
c764ddc64a
commit
e78bdb3ea6
3 changed files with 9 additions and 15 deletions
|
@ -434,8 +434,8 @@ R_DrawAliasModel (entity_t *e, qboolean cull)
|
||||||
VectorAdd (e->origin, clmodel->mins, mins);
|
VectorAdd (e->origin, clmodel->mins, mins);
|
||||||
VectorAdd (e->origin, clmodel->maxs, maxs);
|
VectorAdd (e->origin, clmodel->maxs, maxs);
|
||||||
|
|
||||||
if (cull && R_CullBox (mins, maxs))
|
if (cull && R_CullBox (mins, maxs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
VectorCopy (e->origin, r_entorigin);
|
VectorCopy (e->origin, r_entorigin);
|
||||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||||
|
@ -518,9 +518,6 @@ R_DrawAliasModel (entity_t *e, qboolean cull)
|
||||||
|
|
||||||
qfglBindTexture (GL_TEXTURE_2D, texture);
|
qfglBindTexture (GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
if (gl_affinemodels->int_val)
|
|
||||||
qfglHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
|
||||||
|
|
||||||
vo = GL_GetAliasFrameVerts (e->frame, paliashdr, e);
|
vo = GL_GetAliasFrameVerts (e->frame, paliashdr, e);
|
||||||
|
|
||||||
GL_DrawAliasFrame (vo, false);
|
GL_DrawAliasFrame (vo, false);
|
||||||
|
@ -531,16 +528,10 @@ R_DrawAliasModel (entity_t *e, qboolean cull)
|
||||||
GL_DrawAliasFrame (vo, true);
|
GL_DrawAliasFrame (vo, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gl_affinemodels->int_val)
|
|
||||||
qfglHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE);
|
|
||||||
|
|
||||||
qfglPopMatrix ();
|
qfglPopMatrix ();
|
||||||
|
|
||||||
if (r_shadows->int_val) {
|
// torches, grenades, and lightning bolts do not have shadows
|
||||||
// torches, grenades, and lightning bolts do not have shadows
|
if (r_shadows->int_val && clmodel->shadow_alpha) {
|
||||||
if (!clmodel->shadow_alpha)
|
|
||||||
return;
|
|
||||||
|
|
||||||
qfglPushMatrix ();
|
qfglPushMatrix ();
|
||||||
R_RotateForEntity (e);
|
R_RotateForEntity (e);
|
||||||
|
|
||||||
|
|
|
@ -116,8 +116,7 @@ R_DrawSpriteModel (entity_t *e)
|
||||||
mspriteframe_t *frame;
|
mspriteframe_t *frame;
|
||||||
vec3_t point, v_forward, v_right, v_up;
|
vec3_t point, v_forward, v_right, v_up;
|
||||||
|
|
||||||
// don't even bother culling, because it's just a single
|
// don't bother culling, it's just a single polygon without a surface cache
|
||||||
// polygon without a surface cache
|
|
||||||
frame = R_GetSpriteFrame (e);
|
frame = R_GetSpriteFrame (e);
|
||||||
psprite = e->model->cache.data;
|
psprite = e->model->cache.data;
|
||||||
|
|
||||||
|
|
|
@ -182,6 +182,8 @@ R_DrawEntitiesOnList (void)
|
||||||
R_DrawBrushModel (currententity);
|
R_DrawBrushModel (currententity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gl_affinemodels->int_val)
|
||||||
|
qfglHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||||
for (i = 0; i < r_numvisedicts; i++) {
|
for (i = 0; i < r_numvisedicts; i++) {
|
||||||
if (r_visedicts[i]->model->type != mod_alias)
|
if (r_visedicts[i]->model->type != mod_alias)
|
||||||
continue;
|
continue;
|
||||||
|
@ -192,6 +194,8 @@ R_DrawEntitiesOnList (void)
|
||||||
|
|
||||||
R_DrawAliasModel (currententity, true);
|
R_DrawAliasModel (currententity, true);
|
||||||
}
|
}
|
||||||
|
if (gl_affinemodels->int_val)
|
||||||
|
qfglHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_DONT_CARE);
|
||||||
|
|
||||||
qfglColor3ubv (color_white);
|
qfglColor3ubv (color_white);
|
||||||
qfglEnable (GL_ALPHA_TEST);
|
qfglEnable (GL_ALPHA_TEST);
|
||||||
|
|
Loading…
Reference in a new issue