side = fabs(side);
value = cl_rollangle.value;
-// if (cl.inwater)
-// value *= 6;
if (side < cl_rollspeed.value)
side = side * value / cl_rollspeed.value;
// (don't count Z, or jumping messes it up)
bob = sqrt(cl.velocity[0]*cl.velocity[0] + cl.velocity[1]*cl.velocity[1]) * cl_bob.value;
- //Con_Printf ("speed: %5.1f\n", Length(cl.velocity));
bob = bob*0.3 + bob*0.7*sin(cycle);
bob = bound(-7, bob, 4);
return bob;
void V_StartPitchDrift (void)
{
-#if 1
if (cl.laststop == cl.time)
- {
return; // something else is keeping it from drifting
- }
-#endif
+
if (cl.nodrift || !cl.pitchvel)
{
cl.pitchvel = v_centerspeed.value;
move = cl.frametime * cl.pitchvel;
cl.pitchvel += cl.frametime * v_centerspeed.value;
-//Con_Printf ("move: %f (%f)\n", move, cl.frametime);
-
if (delta > 0)
{
if (move > delta)
}
-
-
-
/*
==============================================================================
float r, g, b, a, a2;
int j;
- if (cl.worldmodel == NULL)
+ if (cls.signon != SIGNONS)
{
cl.cshifts[CSHIFT_DAMAGE].percent = 0;
cl.cshifts[CSHIFT_BONUS].percent = 0;
cl.cshifts[CSHIFT_BONUS].percent = 0;
// set contents color
- switch (Mod_PointInLeaf (r_refdef.vieworg, cl.worldmodel)->contents)
+ switch (Mod_PointContents (r_refdef.vieworg, cl.worldmodel))
{
case CONTENTS_EMPTY:
case CONTENTS_SOLID:
cl.cshifts[CSHIFT_CONTENTS].destcolor[0] = 255;
cl.cshifts[CSHIFT_CONTENTS].destcolor[1] = 80;
cl.cshifts[CSHIFT_CONTENTS].destcolor[2] = 0;
- cl.cshifts[CSHIFT_CONTENTS].percent = 150;
+ cl.cshifts[CSHIFT_CONTENTS].percent = 150 >> 1;
break;
case CONTENTS_SLIME:
cl.cshifts[CSHIFT_CONTENTS].destcolor[0] = 0;
cl.cshifts[CSHIFT_CONTENTS].destcolor[1] = 25;
cl.cshifts[CSHIFT_CONTENTS].destcolor[2] = 5;
- cl.cshifts[CSHIFT_CONTENTS].percent = 150;
+ cl.cshifts[CSHIFT_CONTENTS].percent = 150 >> 1;
break;
default:
cl.cshifts[CSHIFT_CONTENTS].destcolor[0] = 130;
cl.cshifts[CSHIFT_CONTENTS].destcolor[1] = 80;
cl.cshifts[CSHIFT_CONTENTS].destcolor[2] = 50;
- cl.cshifts[CSHIFT_CONTENTS].percent = 128;
+ cl.cshifts[CSHIFT_CONTENTS].percent = 128 >> 1;
}
if (cl.items & IT_QUAD)
float bob;
float side;
- if (cls.state != ca_connected || !cl.worldmodel)
+ if (cls.state != ca_connected || cls.signon != SIGNONS)
return;
// ent is the player model (visible when out of body)
r_refdef.vieworg[2] += cl.viewheight + bob;
+ // LordHavoc: origin view kick added
+ if (!intimerefresh)
+ {
+ VectorAdd(r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
+ VectorAdd(r_refdef.vieworg, cl.punchvector, r_refdef.vieworg);
+ }
+
// 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);
view->render.angles[ROLL] = r_refdef.viewangles[ROLL] - v_idlescale.value * sin(cl.time*v_iroll_cycle.value) * v_iroll_level.value;
// FIXME: this setup code is somewhat evil (CL_LerpUpdate should be private?)
CL_LerpUpdate(view);
+ CL_BoundingBoxForEntity(&view->render);
view->render.colormap = -1; // no special coloring
view->render.alpha = ent->render.alpha; // LordHavoc: if the player is transparent, so is the gun
view->render.effects = ent->render.effects;
view->render.scale = 1.0 / 3.0;
- // LordHavoc: origin view kick added
- if (!intimerefresh)
- {
- VectorAdd(r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
- 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;
}
}
Cvar_RegisterVariable (&v_kickpitch);
}
-