Fix idealpitch and viewheight in qw.

For certain values of "fix" ;). Both are brought back to life but
idealpitch is never set (always 0) and veiwheight is set in V_RenderView().
However, this brings the rest of the code in cl_view.c just that little bit
closer to merged :)
This commit is contained in:
Bill Currie 2012-05-31 08:11:39 +09:00
parent 3fd279ea6c
commit 83d6dd7262
3 changed files with 17 additions and 14 deletions

View file

@ -290,6 +290,8 @@
#define TE_EXPLOSION2 16
#define TE_BEAM 17 // PGM 01/21/97
#define DEFAULT_VIEWHEIGHT 22
// ELEMENTS COMMUNICATED ACROSS THE NET =======================================
#define MAX_CLIENTS 32

View file

@ -240,12 +240,14 @@ typedef struct {
vec3_t simangles;
// pitch drifting vars
float idealpitch;
float pitchvel;
qboolean nodrift;
float driftmove;
double laststop;
int onground; // -1 when in air
float viewheight;
float crouch; // local amount for smoothing stepups
qboolean paused; // send over by server

View file

@ -207,7 +207,7 @@ V_DriftPitch (void)
return;
}
delta = 0 - cl.viewangles[PITCH];
delta = cl.idealpitch - cl.viewangles[PITCH];
if (!delta) {
cl.pitchvel = 0;
@ -591,12 +591,8 @@ V_CalcRefdef (void)
float bob;
static float oldz = 0;
int i;
int zofs = 22;
vec3_t forward, right, up;
if (cl.stdver)
zofs = cl.stats[STAT_VIEWHEIGHT];
V_DriftPitch ();
// view is the weapon model (visible only from inside body)
@ -606,7 +602,7 @@ V_CalcRefdef (void)
// refresh position from simulated origin
VectorCopy (cl.simorg, r_data->refdef->vieworg);
r_data->refdef->vieworg[2] += bob;
r_data->refdef->vieworg[2] += cl.viewheight + bob;
// never let it sit exactly on a node line, because a water plane can
// disappear when viewed with the eye exactly on it.
@ -619,13 +615,6 @@ V_CalcRefdef (void)
V_CalcViewRoll ();
V_AddIdle ();
if (view_message->pls.flags & PF_GIB)
r_data->refdef->vieworg[2] += 8; // gib view height
else if (view_message->pls.flags & PF_DEAD)
r_data->refdef->vieworg[2] -= 16; // corpse view height
else
r_data->refdef->vieworg[2] += zofs; // view height
if (view_message->pls.flags & PF_DEAD) // PF_GIB will also set PF_DEAD
r_data->refdef->viewangles[ROLL] = 80; // dead view angle
@ -638,7 +627,7 @@ V_CalcRefdef (void)
CalcGunAngle ();
VectorCopy (cl.simorg, view->origin);
view->origin[2] += zofs;
view->origin[2] += cl.viewheight;
for (i = 0; i < 3; i++) {
view->origin[i] += forward[i] * bob * 0.4;
@ -716,6 +705,16 @@ V_RenderView (void)
view_frame = &cl.frames[cls.netchan.incoming_sequence & UPDATE_MASK];
view_message = &view_frame->playerstate[cl.playernum];
if (view_message->pls.flags & PF_GIB)
cl.viewheight = 8; // gib view height
else if (view_message->pls.flags & PF_DEAD)
cl.viewheight = -16; // corpse view height
else {
cl.viewheight = DEFAULT_VIEWHEIGHT; // view height
if (cl.stdver)
cl.viewheight = cl.stats[STAT_VIEWHEIGHT];
}
DropPunchAngle ();
if (cl.intermission) { // intermission / finale rendering
V_CalcIntermissionRefdef ();