From: havoc Date: Fri, 4 Feb 2005 11:50:50 +0000 (+0000) Subject: now lerps punchangle and punchvector X-Git-Tag: xonotic-v0.1.0preview~5160 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0f6c9bbdf70058db34de7e5ddd8db94d8900b2c4;p=xonotic%2Fdarkplaces.git now lerps punchangle and punchvector git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5001 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_main.c b/cl_main.c index 19d058e3..387dd633 100644 --- a/cl_main.c +++ b/cl_main.c @@ -112,7 +112,7 @@ void CL_ClearState(void) // 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); @@ -233,7 +233,7 @@ void CL_EstablishConnection(const char *host) 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; @@ -1146,10 +1146,13 @@ void CL_LerpPlayer(float frac) 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) { diff --git a/cl_parse.c b/cl_parse.c index 271d29af..d7432e0c 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -441,7 +441,7 @@ void CL_ParseServerInfo (void) { 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); } @@ -607,7 +607,10 @@ void CL_ParseClientdata (int bits) { 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) { @@ -616,15 +619,16 @@ void CL_ParseClientdata (int bits) 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) @@ -643,18 +647,18 @@ void CL_ParseClientdata (int bits) if (bits & (SU_PUNCH1<