mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 13:10:34 +00:00
Much diff noise reduction in V_CalcRefdef.
NQ's client-side onground now works similarly to QW's: -1 = not on ground, 0+ = on ground (plane num?) but only 0 is used in NQ as the necessary information is not sent over the network.
This commit is contained in:
parent
86ecab4ff7
commit
c4d7b65a05
4 changed files with 13 additions and 11 deletions
|
@ -186,7 +186,7 @@ typedef struct {
|
|||
float crouch; // Local amount for smoothing stepups
|
||||
|
||||
qboolean paused; // Sent over by server
|
||||
qboolean onground;
|
||||
int onground;
|
||||
qboolean inwater;
|
||||
|
||||
int intermission; // Don't change view angle, full screen, etc
|
||||
|
|
|
@ -717,7 +717,7 @@ CL_ParseClientdata (void)
|
|||
cl.stats[STAT_ITEMS] = i;
|
||||
}
|
||||
|
||||
cl.onground = (bits & SU_ONGROUND) != 0;
|
||||
cl.onground = (bits & SU_ONGROUND) ? 0 : -1;
|
||||
cl.inwater = (bits & SU_INWATER) != 0;
|
||||
|
||||
if (bits & SU_WEAPONFRAME)
|
||||
|
@ -882,7 +882,7 @@ CL_ParseServerMessage (void)
|
|||
else if (cl_shownet->int_val == 2)
|
||||
Sys_Printf ("------------------\n");
|
||||
|
||||
cl.onground = false; // unless the server says otherwise
|
||||
cl.onground = -1; // unless the server says otherwise
|
||||
|
||||
// parse the message
|
||||
MSG_BeginReading (net_message);
|
||||
|
|
|
@ -174,7 +174,7 @@ V_DriftPitch (void)
|
|||
{
|
||||
float delta, move;
|
||||
|
||||
if (noclip_anglehack || !cl.onground || cls.demoplayback) {
|
||||
if (noclip_anglehack || cl.onground == -1 || cls.demoplayback) {
|
||||
cl.driftmove = 0;
|
||||
cl.pitchvel = 0;
|
||||
return;
|
||||
|
@ -610,6 +610,7 @@ V_CalcRefdef (void)
|
|||
vec3_t angles;
|
||||
vec3_t forward, right, up;
|
||||
vec_t *origin = ent->origin;
|
||||
vec_t *viewangles = cl.viewangles;
|
||||
|
||||
V_DriftPitch ();
|
||||
|
||||
|
@ -626,7 +627,7 @@ V_CalcRefdef (void)
|
|||
r_data->refdef->vieworg[1] += 1.0 / 16;
|
||||
r_data->refdef->vieworg[2] += 1.0 / 16;
|
||||
|
||||
VectorCopy (cl.viewangles, r_data->refdef->viewangles);
|
||||
VectorCopy (viewangles, r_data->refdef->viewangles);
|
||||
V_CalcViewRoll ();
|
||||
V_AddIdle ();
|
||||
|
||||
|
@ -651,7 +652,7 @@ V_CalcRefdef (void)
|
|||
V_BoundOffsets ();
|
||||
|
||||
// set up gun position
|
||||
VectorCopy (cl.viewangles, view->angles);
|
||||
VectorCopy (viewangles, view->angles);
|
||||
|
||||
CalcGunAngle ();
|
||||
|
||||
|
@ -687,7 +688,7 @@ V_CalcRefdef (void)
|
|||
r_data->refdef->viewangles);
|
||||
|
||||
// smooth out stair step ups
|
||||
if (cl.onground && origin[2] - oldz > 0) {
|
||||
if ((cl.onground != -1) && (origin[2] - oldz > 0)) {
|
||||
float steptime;
|
||||
|
||||
steptime = cl.time - cl.oldtime;
|
||||
|
|
|
@ -617,12 +617,13 @@ V_CalcRefdef (void)
|
|||
int i;
|
||||
vec3_t forward, right, up;
|
||||
vec_t *origin = cl.simorg;
|
||||
vec_t *viewangles = cl.simangles;
|
||||
|
||||
V_DriftPitch ();
|
||||
|
||||
bob = V_CalcBob ();
|
||||
|
||||
// refresh position from simulated origin
|
||||
// refresh position
|
||||
VectorCopy (origin, r_data->refdef->vieworg);
|
||||
r_data->refdef->vieworg[2] += cl.viewheight + bob;
|
||||
|
||||
|
@ -633,12 +634,12 @@ V_CalcRefdef (void)
|
|||
r_data->refdef->vieworg[1] += 1.0 / 16;
|
||||
r_data->refdef->vieworg[2] += 1.0 / 16;
|
||||
|
||||
VectorCopy (cl.simangles, r_data->refdef->viewangles);
|
||||
VectorCopy (viewangles, r_data->refdef->viewangles);
|
||||
V_CalcViewRoll ();
|
||||
V_AddIdle ();
|
||||
|
||||
// offsets
|
||||
AngleVectors (cl.simangles, forward, right, up);
|
||||
AngleVectors (viewangles, forward, right, up);
|
||||
|
||||
// don't allow cheats in multiplayer
|
||||
// FIXME check for dead
|
||||
|
@ -653,7 +654,7 @@ V_CalcRefdef (void)
|
|||
V_BoundOffsets ();
|
||||
|
||||
// set up gun position
|
||||
VectorCopy (cl.simangles, view->angles);
|
||||
VectorCopy (viewangles, view->angles);
|
||||
|
||||
CalcGunAngle ();
|
||||
|
||||
|
|
Loading…
Reference in a new issue