// reset the view zoom interpolation
cl.mviewzoom[0] = cl.mviewzoom[1] = 1;
+ // enable rendering of the world and such
+ cl.csqc_vidvars.drawworld = true;
+ cl.csqc_vidvars.drawenginesbar = true;
+ cl.csqc_vidvars.drawcrosshair = true;
+
+ // 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;
Con_DPrint("Sending clc_disconnect\n");
MSG_WriteByte(&buf, clc_disconnect);
}
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000);
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000);
- NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, false);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, false);
+ NetConn_SendUnreliableMessage(cls.netcon, &buf, cls.protocol, 10000, false);
NetConn_Close(cls.netcon);
cls.netcon = NULL;
}
modelname = ent->render.model->name;
else
modelname = "--no model--";
- Con_Printf("%3i: %-25s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, modelname, ent->render.frame, (int) ent->state_current.origin[0], (int) ent->state_current.origin[1], (int) ent->state_current.origin[2], (int) ent->state_current.angles[0] % 360, (int) ent->state_current.angles[1] % 360, (int) ent->state_current.angles[2] % 360, ent->render.scale, ent->render.alpha);
+ Con_Printf("%3i: %-25s:%4i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, modelname, ent->render.frame2, (int) ent->state_current.origin[0], (int) ent->state_current.origin[1], (int) ent->state_current.origin[2], (int) ent->state_current.angles[0] % 360, (int) ent->state_current.angles[1] % 360, (int) ent->state_current.angles[2] % 360, ent->render.scale, ent->render.alpha);
}
}
else if (e->render.flags & RENDER_VIEWMODEL)
{
// view-relative entity (guns and such)
- matrix = &viewmodelmatrix;
+ if (e->render.effects & EF_NOGUNBOB)
+ matrix = &r_view.matrix; // really attached to view
+ else
+ matrix = &viewmodelmatrix; // attached to gun bob matrix
}
else
{
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];
// begin a new frame lerp
e->render.frame1 = e->render.frame2;
e->render.frame1time = e->render.frame2time;
- e->render.frame = e->render.frame2 = e->state_current.frame;
+ e->render.frame2 = e->state_current.frame;
e->render.frame2time = cl.time;
e->render.framelerp = 0;
}
// do trails
if (e->render.flags & RENDER_GLOWTRAIL)
trailtype = EFFECT_TR_GLOWTRAIL;
- // be sure to check for changes in e->state_previous.active and
- // modelindex so that entities which did not exist in the previous
- // frame don't create a trail from the start location
- if (trailtype && e->state_previous.active && e->state_previous.modelindex == e->state_current.modelindex)
+ // 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);
}
ent->state_current.modelindex = 0;
}
ent->state_current.alpha = cl.entities[cl.viewentity].state_current.alpha;
- ent->state_current.effects = EF_NOSHADOW | (cl.entities[cl.viewentity].state_current.effects & (EF_ADDITIVE | EF_FULLBRIGHT | EF_NODEPTHTEST));
+ ent->state_current.effects = EF_NOSHADOW | (cl.entities[cl.viewentity].state_current.effects & (EF_ADDITIVE | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB));
// reset animation interpolation on weaponmodel if model changed
if (ent->state_previous.modelindex != ent->state_current.modelindex)
{
- ent->render.frame = ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
+ ent->render.frame1 = ent->render.frame2 = ent->state_current.frame;
ent->render.frame1time = ent->render.frame2time = cl.time;
ent->render.framelerp = 1;
}
// 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)
ent->render.model = cl.model_precache[e->modelindex];
else
ent->render.model = cl.csqc_model_precache[-(e->modelindex+1)];
- ent->render.frame = ent->render.frame2;
ent->render.colormap = -1; // no special coloring
ent->render.alpha = 1;
VectorSet(ent->render.colormod, 1, 1, 1);
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();