]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
added GAME_THEHUNTED
[xonotic/darkplaces.git] / cl_main.c
index ca72d8a72aa88dc91582840ba8efff271f9c2724..387dd63377e4c0f2de70910d2750fef2d9432ccf 100644 (file)
--- 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;
@@ -959,10 +959,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 +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)
        {
@@ -1300,6 +1304,23 @@ static void CL_TimeRefresh_f (void)
        Con_Printf("%f seconds (%f fps)\n", timedelta, 128/timedelta);
 }
 
+/*
+===========
+CL_Shutdown
+===========
+*/
+void CL_Shutdown (void)
+{
+       CL_CGVM_Shutdown();
+       CL_Particles_Shutdown();
+       CL_Parse_Shutdown();
+
+       SZ_Free (&cls.message);
+
+       Mem_FreePool (&cl_entities_mempool);
+       Mem_FreePool (&cl_refdef_mempool);
+}
+
 /*
 =================
 CL_Init