]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
Updated a few entries in the todo file
[xonotic/darkplaces.git] / cl_main.c
index 041247d1f8039d23d6449687e1b9833d2282f747..94f52fe8757d1f22958e87772eb8f9ebdefba8b6 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 cvar_t cl_shownet = {0, "cl_shownet","0"};
 cvar_t cl_nolerp = {0, "cl_nolerp", "0"};
 
-cvar_t cl_itembobheight = {0, "cl_itembobheight", "8"};
+cvar_t cl_itembobheight = {0, "cl_itembobheight", "0"}; // try 8
 cvar_t cl_itembobspeed = {0, "cl_itembobspeed", "0.5"};
 
 cvar_t lookspring = {CVAR_SAVE, "lookspring","0"};
@@ -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;
@@ -560,17 +560,18 @@ void CL_LinkNetworkEntity(entity_t *e)
                        e->render.flags |= t->render.flags & RENDER_EXTERIORMODEL;
                        // if a valid tagindex is used, make it relative to that tag instead
                        // FIXME: use a model function to get tag info (need to handle skeletal)
-                       if (e->state_current.tagentity && e->state_current.tagindex >= 1 && (model = t->render.model) && e->state_current.tagindex <= t->render.model->alias.aliasnum_tags)
+                       if (e->state_current.tagentity && e->state_current.tagindex >= 1 && (model = t->render.model))
                        {
                                // blend the matrices
                                memset(&blendmatrix, 0, sizeof(blendmatrix));
                                for (j = 0;j < 4 && t->render.frameblend[j].lerp > 0;j++)
                                {
-                                       matrix = &t->render.model->alias.aliasdata_tags[t->render.frameblend[j].frame * t->render.model->alias.aliasnum_tags + (e->state_current.tagindex - 1)].matrix;
+                                       matrix4x4_t tagmatrix;
+                                       Mod_Alias_GetTagMatrix(model, t->render.frameblend[j].frame, e->state_current.tagindex - 1, &tagmatrix);
                                        d = t->render.frameblend[j].lerp;
                                        for (l = 0;l < 4;l++)
                                                for (k = 0;k < 4;k++)
-                                                       blendmatrix.m[l][k] += d * matrix->m[l][k];
+                                                       blendmatrix.m[l][k] += d * tagmatrix.m[l][k];
                                }
                                // concat the tag matrices onto the entity matrix
                                Matrix4x4_Concat(&tempmatrix, &t->render.matrix, &blendmatrix);
@@ -959,10 +960,11 @@ static void CL_RelinkNetworkEntities(void)
 
        // start on the entity after the world
        entitylinkframenumber++;
-       for (i = 1, ent = cl_entities + 1;i < MAX_EDICTS;i++, ent++)
+       for (i = 1;i < MAX_EDICTS;i++)
        {
                if (cl_entities_active[i])
                {
+                       ent = cl_entities + i;
                        if (ent->state_current.active)
                                CL_LinkNetworkEntity(ent);
                        else
@@ -1145,10 +1147,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)
        {