// wipe the entire cl structure
memset (&cl, 0, sizeof(cl));
// reset the view zoom interpolation
- cl.viewzoomold = cl.viewzoomnew = 1;
+ cl.mviewzoom[0] = cl.mviewzoom[1] = 1;
SZ_Clear (&cls.message);
CL_Disconnect();
NetConn_ClientFrame();
NetConn_ServerFrame();
-
+
if (LHNETADDRESS_FromString(&cls.connect_address, host, 26000) && (cls.connect_mysocket = NetConn_ChooseClientSocketForAddress(&cls.connect_address)))
{
cls.connect_trying = true;
int i;
float d;
- cl.viewzoom = cl.viewzoomold + frac * (cl.viewzoomnew - cl.viewzoomold);
-
+ cl.viewzoom = cl.mviewzoom[1] + frac * (cl.mviewzoom[0] - cl.mviewzoom[1]);
for (i = 0;i < 3;i++)
+ {
+ cl.punchangle[i] = cl.mpunchangle[1][i] + frac * (cl.mpunchangle[0][i] - cl.mpunchangle[1][i]);
+ cl.punchvector[i] = cl.mpunchvector[1][i] + frac * (cl.mpunchvector[0][i] - cl.mpunchvector[1][i]);
cl.velocity[i] = cl.mvelocity[1][i] + frac * (cl.mvelocity[0][i] - cl.mvelocity[1][i]);
+ }
if (cls.demoplayback)
{
{
CL_KeepaliveMessage();
- // Don't lock the sfx here, S_ServerSounds already did that
+ // Don't lock the sfx here, S_ServerSounds already did that
cl.sound_precache[i] = S_PrecacheSound (parse_sound_precache[i], true, false);
}
{
int i, j;
+ VectorCopy (cl.mpunchangle[0], cl.mpunchangle[1]);
+ VectorCopy (cl.mpunchvector[0], cl.mpunchvector[1]);
VectorCopy (cl.mvelocity[0], cl.mvelocity[1]);
+ cl.mviewzoom[1] = cl.mviewzoom[0];
if (cl.protocol != PROTOCOL_DARKPLACES6)
{
cl.stats[STAT_VIEWZOOM] = 255;
}
cl.idealpitch = 0;
- cl.punchangle[0] = 0;
- cl.punchangle[1] = 0;
- cl.punchangle[2] = 0;
- cl.punchvector[0] = 0;
- cl.punchvector[1] = 0;
- cl.punchvector[2] = 0;
+ cl.mpunchangle[0][0] = 0;
+ cl.mpunchangle[0][1] = 0;
+ cl.mpunchangle[0][2] = 0;
+ cl.mpunchvector[0][0] = 0;
+ cl.mpunchvector[0][1] = 0;
+ cl.mpunchvector[0][2] = 0;
cl.mvelocity[0][0] = 0;
cl.mvelocity[0][1] = 0;
cl.mvelocity[0][2] = 0;
+ cl.mviewzoom[0] = 1;
bits &= 0xFFFF;
if (bits & SU_EXTEND1)
if (bits & (SU_PUNCH1<<i) )
{
if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5 || cl.protocol == PROTOCOL_DARKPLACES6)
- cl.punchangle[i] = MSG_ReadAngle16i();
+ cl.mpunchangle[0][i] = MSG_ReadAngle16i();
else if (cl.protocol == PROTOCOL_QUAKE || cl.protocol == PROTOCOL_NEHAHRAMOVIE)
- cl.punchangle[i] = MSG_ReadChar();
+ cl.mpunchangle[0][i] = MSG_ReadChar();
else
Host_Error("CL_ParseClientData: unknown cl.protocol %i\n", cl.protocol);
}
if (bits & (SU_PUNCHVEC1<<i))
{
if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
- cl.punchvector[i] = MSG_ReadCoord16i();
+ cl.mpunchvector[0][i] = MSG_ReadCoord16i();
else if (cl.protocol == PROTOCOL_DARKPLACES5 || cl.protocol == PROTOCOL_DARKPLACES6)
- cl.punchvector[i] = MSG_ReadCoord32f();
+ cl.mpunchvector[0][i] = MSG_ReadCoord32f();
else
Host_Error("CL_ParseClientData: unknown cl.protocol %i\n", cl.protocol);
}
cl.activeweapon = cl.stats[STAT_ACTIVEWEAPON];
// viewzoom interpolation
- cl.viewzoomold = cl.viewzoomnew;
- cl.viewzoomnew = (float) max(cl.stats[STAT_VIEWZOOM], 2) * (1.0f / 255.0f);
+ cl.mviewzoom[0] = (float) max(cl.stats[STAT_VIEWZOOM], 2) * (1.0f / 255.0f);
}
/*
color[0] = MSG_ReadCoord(cl.protocol) * (2.0f / 1.0f);
color[1] = MSG_ReadCoord(cl.protocol) * (2.0f / 1.0f);
color[2] = MSG_ReadCoord(cl.protocol) * (2.0f / 1.0f);
- CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+ CL_AllocDlight(NULL, &tempmatrix, 350, color[0], color[1], color[2], 700, 0.5, 0, -1, true, 1, 0.25, 0.25, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
S_StartSound(-1, 0, cl_sfx_r_exp3, pos, 1, 1);
break;
typedef struct rtlight_s
{
- // shadow volumes are done entirely in model space, so there are no matrices for dealing with them... they just use the origin
+ // shadow volumes are done entirely in model space, so there are no matrices for dealing with them... they just use the origin
// note that the world to light matrices are inversely scaled (divided) by lightradius
vec_t specularscale;
// LIGHTFLAG_* flags
int flags;
-
+
// generated properties
// used only for shadow volumes
vec3_t shadoworigin;
// (worldlight only)
struct dlight_s *next;
// embedded rtlight struct for renderer
- // (renderer only)
+ // (renderer only)
rtlight_t rtlight;
}
dlight_t;
// the view is temporarily offset, and an angle reset commands at the start
// of each level and after teleporting.
- // during demo playback viewangles is lerped between these
- vec3_t mviewangles[2];
- // either client controlled, or lerped from demo mviewangles
- vec3_t viewangles;
-
+ // mviewangles is read from demo
+ // viewangles is either client controlled or lerped from mviewangles
+ vec3_t mviewangles[2], viewangles;
+ // update by server, used by qc to do weapon recoil
+ vec3_t mpunchangle[2], punchangle;
+ // update by server, can be used by mods to kick view around
+ vec3_t mpunchvector[2], punchvector;
// update by server, used for lean+bob (0 is newest)
- vec3_t mvelocity[2];
- // lerped between mvelocity[0] and [1]
- vec3_t velocity;
-
- // temporary offset
- vec3_t punchangle;
- // LordHavoc: origin view kick
- vec3_t punchvector;
+ vec3_t mvelocity[2], velocity;
+ // update by server, can be used by mods for zooming
+ vec_t mviewzoom[2], viewzoom;
// pitch drifting vars
float idealpitch;
// [cl.maxclients]
scoreboard_t *scores;
- // LordHavoc: sniping zoom, QC controlled
- float viewzoom;
- // for interpolation
- float viewzoomold, viewzoomnew;
-
// protocol version of the server we're connected to
int protocol;