- ent->angles[YAW] = cl.viewangles[YAW]; // the model should face the view dir
- ent->angles[PITCH] = -cl.viewangles[PITCH]; // the model should face the view dir
- }
-
-
- bob = V_CalcBob ();
-
-// refresh position
- VectorCopy (ent->origin, r_refdef.vieworg);
- r_refdef.vieworg[2] += cl.viewheight + bob;
-
-// never let it sit exactly on a node line, because a water plane can
-// dissapear when viewed with the eye exactly on it.
-// the server protocol only specifies to 1/16 pixel, so add 1/32 in each axis
- r_refdef.vieworg[0] += 1.0/32;
- r_refdef.vieworg[1] += 1.0/32;
- r_refdef.vieworg[2] += 1.0/32;
-
- if (!intimerefresh)
- {
- VectorCopy (cl.viewangles, r_refdef.viewangles);
- }
- V_CalcViewRoll ();
- V_AddIdle ();
-
-// offsets
- angles[PITCH] = -ent->angles[PITCH]; // because entity pitches are
- // actually backward
- angles[YAW] = ent->angles[YAW];
- angles[ROLL] = ent->angles[ROLL];
-
- AngleVectors (angles, forward, right, up);
-
- V_BoundOffsets ();
-
-// set up gun position
- VectorCopy (cl.viewangles, view->angles);
-
- CalcGunAngle ();
-
- VectorCopy (ent->origin, view->origin);
- view->origin[2] += cl.viewheight;
-
- for (i=0 ; i<3 ; i++)
- {
- view->origin[i] += forward[i]*bob*0.4;
-// view->origin[i] += right[i]*bob*0.4;
-// view->origin[i] += up[i]*bob*0.8;
- }
- view->origin[2] += bob;
-
-// fudge position around to keep amount of weapon visible
-// roughly equal with different FOV
-
-#if 0
- if (cl.model_precache[cl.stats[STAT_WEAPON]] && strcmp (cl.model_precache[cl.stats[STAT_WEAPON]]->name, "progs/v_shot2.mdl"))
-#endif
-// LordHavoc: everyone hates the gun moving around
-/*
- if (scr_viewsize.value == 110)
- view->origin[2] += 1;
- else if (scr_viewsize.value == 100)
- view->origin[2] += 2;
- else if (scr_viewsize.value == 90)
- view->origin[2] += 1;
- else if (scr_viewsize.value == 80)
- view->origin[2] += 0.5;
-*/
-
- view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
- view->frame = cl.stats[STAT_WEAPONFRAME];
- view->colormap = -1; // no special coloring
-
-// set up the refresh position
- if (!intimerefresh)
- {
- VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
- }
-
-// smooth out stair step ups
-if (cl.onground && ent->origin[2] - oldz > 0)
-{
- float steptime;
-
- steptime = cl.time - cl.oldtime;
- if (steptime < 0)
-//FIXME I_Error ("steptime < 0");
- steptime = 0;
-
- oldz += steptime * 80;
- if (oldz > ent->origin[2])
- oldz = ent->origin[2];
- if (ent->origin[2] - oldz > 12)
- oldz = ent->origin[2] - 12;
- r_refdef.vieworg[2] += oldz - ent->origin[2];
- view->origin[2] += oldz - ent->origin[2];
-}
-else
- oldz = ent->origin[2];
-
- if (chase_active.value)
- Chase_Update ();
-}
+ // set contents color
+ switch (CL_PointContents(r_refdef.vieworg))
+ {
+ case CONTENTS_EMPTY:
+ case CONTENTS_SOLID:
+ cl.cshifts[CSHIFT_CONTENTS].destcolor[0] = v_cshift.destcolor[0];
+ cl.cshifts[CSHIFT_CONTENTS].destcolor[1] = v_cshift.destcolor[1];
+ cl.cshifts[CSHIFT_CONTENTS].destcolor[2] = v_cshift.destcolor[2];
+ cl.cshifts[CSHIFT_CONTENTS].percent = v_cshift.percent;
+ break;
+ case CONTENTS_LAVA:
+ 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 >> 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 >> 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 >> 1;
+ }