render: replace insubmodel global parameter

Use a local check of the current entity model against r_worldentity
model.  Still a bit of a hack, but one less global to worry about.

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-04-17 11:56:35 +09:30
parent 8398c6cc0e
commit 4b37003a74
4 changed files with 2 additions and 6 deletions

View File

@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// current entity info
//
qboolean insubmodel;
// modelorg is the viewpoint reletive to
// the currently rendering entity

View File

@ -358,7 +358,8 @@ R_RenderFace
void
R_RenderFace(const entity_t *e, msurface_t *fa, int clipflags)
{
brushmodel_t *brushmodel = BrushModel(e->model);
const brushmodel_t *brushmodel = BrushModel(e->model);
const qboolean insubmodel = e->model != r_worldentity.model;
int i, lindex;
unsigned mask;
mplane_t *pplane;

View File

@ -959,7 +959,6 @@ R_DrawBEntitiesOnList(void)
return;
VectorCopy(modelorg, oldorigin);
insubmodel = true;
r_dlightframecount = r_framecount;
for (i = 0; i < cl_numvisedicts; i++) {
@ -1026,8 +1025,6 @@ R_DrawBEntitiesOnList(void)
VectorCopy(oldorigin, modelorg);
R_TransformFrustum();
}
insubmodel = false;
}

View File

@ -112,7 +112,6 @@ extern int r_visframecount;
//
// current entity info
//
extern qboolean insubmodel;
void R_DrawSprite(const entity_t *e);
void R_RenderFace(const entity_t *e, msurface_t *fa, int clipflags);