]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
.gitignore: Exclude *.obj and *.tlog. Remove build artifacts
[xonotic/darkplaces.git] / cl_main.c
index 744ef854f7daf62c0deaafa34c37abb91e59e10e..9418ee06f7dd5811921a3dd57a2c92b691cf767e 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -107,6 +107,10 @@ cvar_t cl_maxfps = {CF_CLIENT | CF_ARCHIVE, "cl_maxfps", "0", "maximum fps cap,
 cvar_t cl_maxfps_alwayssleep = {CF_CLIENT | CF_ARCHIVE, "cl_maxfps_alwayssleep","1", "gives up some processing time to other applications each frame, value in milliseconds, disabled if cl_maxfps is 0"};
 cvar_t cl_maxidlefps = {CF_CLIENT | CF_ARCHIVE, "cl_maxidlefps", "20", "maximum fps cap when the game is not the active window (makes cpu time available to other programs"};
 
+cvar_t cl_areagrid_link_SOLID_NOT = {CF_CLIENT, "cl_areagrid_link_SOLID_NOT", "1", "set to 0 to prevent SOLID_NOT entities from being linked to the area grid, and unlink any that are already linked (in the code paths that would otherwise link them), for better performance"};
+cvar_t cl_gameplayfix_nudgeoutofsolid_separation = {CF_CLIENT, "cl_gameplayfix_nudgeoutofsolid_separation", "0.03125", "keep objects this distance apart to prevent collision issues on seams"};
+
+
 client_static_t        cls;
 client_state_t cl;
 
@@ -387,11 +391,13 @@ void CL_DisconnectEx(qbool kicked, const char *fmt, ... )
 
        Con_DPrintf("CL_Disconnect\n");
 
-    Cvar_SetValueQuick(&csqc_progcrc, -1);
+       Cvar_SetValueQuick(&csqc_progcrc, -1);
        Cvar_SetValueQuick(&csqc_progsize, -1);
        CL_VM_ShutDown();
-// stop sounds (especially looping!)
-       S_StopAllSounds ();
+       // stop sounds (especially looping!)
+       S_StopAllSounds();
+       // prevent dlcache assets from this server from interfering with the next one
+       FS_UnloadPacks_dlcache();
 
        cl.parsingtextexpectingpingforscores = 0; // just in case no reply has come yet
 
@@ -598,6 +604,7 @@ void CL_EstablishConnection(const char *address, int firstarg)
 #ifdef CONFIG_MENU
                M_Update_Return_Reason("Trying to connect...");
 #endif
+               SCR_BeginLoadingPlaque(false);
        }
        else
        {
@@ -2549,7 +2556,7 @@ static void CL_MeshEntities_Shutdown(void)
        }
 }
 
-static void CL_MeshEntities_Init(void)
+void CL_MeshEntities_Init(void)
 {
        int i;
        entity_t *ent;
@@ -2585,7 +2592,7 @@ static void CL_MeshEntities_Init(void)
                CL_UpdateRenderEntity(&ent->render);
        }
        cl_meshentities[MESH_UI].render.flags = RENDER_NOSELFSHADOW;
-       R_RegisterModule("cl_meshentities", CL_MeshEntities_Start, CL_MeshEntities_Shutdown, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
+       R_RegisterModule("CL_MeshEntities", CL_MeshEntities_Start, CL_MeshEntities_Shutdown, CL_MeshEntities_Restart, CL_MeshEntities_Restart, CL_MeshEntities_Restart);
 }
 
 void CL_MeshEntities_Scene_Clear(void)
@@ -2806,11 +2813,11 @@ double CL_Frame (double time)
 
        CL_VM_PreventInformationLeaks();
 
-       // get new key events
-       Key_EventQueue_Unblock();
-       SndSys_SendKeyEvents();
-       Sys_SendKeyEvents();
-
+       /*
+        * If the accumulator hasn't become positive, don't
+        * run the frame. Everything that happens before this
+        * point will happen even if we're sleeping this frame.
+        */
        if((cl_timer += time) < 0)
                return cl_timer;
 
@@ -3126,14 +3133,16 @@ void CL_Init (void)
                Cvar_RegisterVariable (&cl_maxfps_alwayssleep);
                Cvar_RegisterVariable (&cl_maxidlefps);
 
+               Cvar_RegisterVariable (&cl_areagrid_link_SOLID_NOT);
+               Cvar_RegisterVariable (&cl_gameplayfix_nudgeoutofsolid_separation);
+
                CL_Parse_Init();
                CL_Particles_Init();
                CL_Screen_Init();
-               CL_MeshEntities_Init();
 
                CL_Video_Init();
 
-               NetConn_UpdateSockets_Client();
+               Cvar_Callback(&cl_netport);
 
                host.hook.ConnectLocal = CL_EstablishConnection_Local;
                host.hook.Disconnect = CL_DisconnectEx;