// reset the view zoom interpolation
cl.mviewzoom[0] = cl.mviewzoom[1] = 1;
+ // set up the float version of the stats array for easier access to float stats
+ cl.statsf = (float *)cl.stats;
+
cl.num_entities = 0;
cl.num_static_entities = 0;
cl.num_temp_entities = 0;
if (e->render.model)
{
// models can set flags such as EF_ROCKET
- e->render.effects |= e->render.model->effects;
+ // this 0xFF800000 mask is EF_NOMODELFLAGS plus all the higher EF_ flags such as EF_ROCKET
+ if (!(e->render.effects & 0xFF800000))
+ e->render.effects |= e->render.model->effects;
// if model is alias or this is a tenebrae-like dlight, reverse pitch direction
if (e->render.model->type == mod_alias)
angles[0] = -angles[0];
// do trails
if (e->render.flags & RENDER_GLOWTRAIL)
trailtype = EFFECT_TR_GLOWTRAIL;
- if (trailtype)
+ // check if a trail is allowed (it is not after a teleport for example)
+ if (trailtype && e->persistent.trail_allowed)
{
float len;
vec3_t vel;
VectorScale(vel, len, vel);
CL_ParticleTrail(trailtype, 1, e->persistent.trail_origin, origin, vel, vel, e, e->state_current.glowcolor, false, true);
}
+ // now that the entity has survived one trail update it is allowed to
+ // leave a real trail on later frames
+ e->persistent.trail_allowed = true;
VectorCopy(origin, e->persistent.trail_origin);
}
// skip inactive entities and world
if (!e->state_current.active || e == cl.entities)
return;
- if (e->render.flags & RENDER_VIEWMODEL && !e->state_current.tagentity)
- {
- if (!r_drawviewmodel.integer || chase_active.integer || r_refdef.envmap)
- return;
- }
- else
+ if (e->state_current.tagentity)
{
// if the tag entity is currently impossible, skip it
if (e->state_current.tagentity >= cl.num_entities)
if (trailtype)
CL_ParticleTrail(trailtype, 0, origin, origin, vec3_origin, vec3_origin, NULL, e->state_current.glowcolor, true, false);
+ // don't show viewmodels in certain situations
+ if (e->render.flags & RENDER_VIEWMODEL)
+ if (!r_drawviewmodel.integer || chase_active.integer || r_refdef.envmap)
+ return;
// don't show entities with no modelindex (note: this still shows
// entities which have a modelindex that resolved to a NULL model)
if (e->render.model && !(e->render.effects & EF_NODRAW) && r_refdef.numentities < r_refdef.maxentities)
vec3_t dist, org, start, end;
float d;
entity_t *ent;
- float yaw, pitch;
+ double yaw, pitch;
float forward;
matrix4x4_t tempmatrix;
}
else
{
- yaw = (int) (atan2(dist[1], dist[0]) * 180 / M_PI);
+ yaw = atan2(dist[1], dist[0]) * 180 / M_PI;
if (yaw < 0)
yaw += 360;
forward = sqrt (dist[0]*dist[0] + dist[1]*dist[1]);
- pitch = (int) (atan2(dist[2], forward) * 180 / M_PI);
+ pitch = atan2(dist[2], forward) * 180 / M_PI;
if (pitch < 0)
pitch += 360;
}
*/
void CL_Shutdown (void)
{
+ CL_Screen_Shutdown();
CL_Particles_Shutdown();
CL_Parse_Shutdown();