}
}
-static void CL_RelinkViewModel(void)
-{
- entity_t *ent;
- if (!r_drawviewmodel.integer || chase_active.integer || envmap || !r_drawentities.integer || cl.items & IT_INVISIBILITY || cl.stats[STAT_HEALTH] <= 0 || cl.viewent.render.model == NULL)
- return;
-
- ent = &cl.viewent;
- // FIXME: set up view model here?
- if (r_refdef.numentities < r_refdef.maxentities)
- r_refdef.entities[r_refdef.numentities++] = &ent->render;
-}
-
void CL_Effect(vec3_t org, int modelindex, int startframe, int framecount, float framerate)
{
int i;
CL_RelinkWorld();
CL_RelinkStaticEntities();
CL_RelinkNetworkEntities();
- CL_RelinkViewModel();
CL_RelinkEffects();
CL_RelinkBeams();
CL_MoveParticles();
// fullscreen color blend
float viewblend[4];
- // weapon model
- entity_render_t viewent;
-
entity_render_t **entities;
int numentities;
int maxentities;
r_refdef.vieworg[2] += cl.viewheight + bob;
// set up gun
+ // (FIXME! this should be in cl_main.c with the other linking code, not view.c!)
view->state_current.modelindex = cl.stats[STAT_WEAPON];
view->state_current.frame = cl.stats[STAT_WEAPONFRAME];
VectorCopy(r_refdef.vieworg, view->render.origin);
VectorAdd(r_refdef.vieworg, cl.punchvector, r_refdef.vieworg);
}
- // copy to refdef
- r_refdef.viewent = view->render;
+ // link into render entities list
+ if (r_refdef.numentities < r_refdef.maxentities && r_drawviewmodel.integer && !chase_active.integer && !envmap && r_drawentities.integer && !(cl.items & IT_INVISIBILITY) && cl.stats[STAT_HEALTH] > 0 && view->render.model != NULL)
+ r_refdef.entities[r_refdef.numentities++] = &view->render;
}
}