]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
Rename COM_CheckParm to Sys_CheckParm and move it to sys_shared.c
[xonotic/darkplaces.git] / cl_main.c
index ef670d166ede8449daf22b95ddecc52585585da7..73fb69861d9e76cf193cfa97d3b7a348ebb8a62f 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -355,7 +355,7 @@ void CL_Disconnect(void)
        if (cls.state == ca_dedicated)
                return;
 
-       if (COM_CheckParm("-profilegameonly"))
+       if (Sys_CheckParm("-profilegameonly"))
                Sys_AllowProfiling(false);
 
        Curl_Clear_forthismap();
@@ -521,7 +521,7 @@ void CL_EstablishConnection(const char *address, int firstarg)
                return;
 
        // don't connect to a server if we're benchmarking a demo
-       if (COM_CheckParm("-benchmark"))
+       if (Sys_CheckParm("-benchmark"))
                return;
 
        // clear menu's connect error message
@@ -569,6 +569,11 @@ void CL_EstablishConnection(const char *address, int firstarg)
        }
 }
 
+static void CL_EstablishConnection_Local(void)
+{
+       CL_EstablishConnection("local:1", -2);
+}
+
 /*
 ==============
 CL_PrintEntities_f
@@ -2723,6 +2728,11 @@ double CL_Frame (double time)
 
        CL_VM_PreventInformationLeaks();
 
+       // get new key events
+       Key_EventQueue_Unblock();
+       SndSys_SendKeyEvents();
+       Sys_SendKeyEvents();
+
        if((cl_timer += time) < 0)
                return cl_timer;
 
@@ -2732,11 +2742,6 @@ double CL_Frame (double time)
 
        if (cls.state != ca_dedicated && (cl_timer > 0 || cls.timedemo || ((vid_activewindow ? cl_maxfps : cl_maxidlefps).value < 1)))
        {
-               // get new key events
-               Key_EventQueue_Unblock();
-               SndSys_SendKeyEvents();
-               Sys_SendKeyEvents();
-
                R_TimeReport("---");
                Collision_Cache_NewFrame();
                R_TimeReport("photoncache");
@@ -2915,7 +2920,7 @@ void CL_Init (void)
        }
        else
        {
-               Con_DPrintf("Initializing client\n");
+               Con_Printf("Initializing client\n");
 
                R_Modules_Init();
                Palette_Init();
@@ -2928,7 +2933,7 @@ void CL_Init (void)
                S_Init();
                CDAudio_Init();
                Key_Init();
-
+               V_Init();
 
                cls.levelmempool = Mem_AllocPool("client (per-level memory)", 0, NULL);
                cls.permanentmempool = Mem_AllocPool("client (long term memory)", 0, NULL);
@@ -3049,6 +3054,8 @@ void CL_Init (void)
 
                CL_Video_Init();
 
+               host.hook.ConnectLocal = CL_EstablishConnection_Local;
+
                #ifdef CONFIG_MENU
                Cbuf_InsertText(&cmd_client,"menu_start\n");
                #endif