]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
Improve windows manifest indenting
[xonotic/darkplaces.git] / cl_main.c
index 17c3fee27053be28382b68427221a5feeb09ef1a..d9256f16917dc859b178a7e8ce71cbd4c67ef71b 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -397,7 +397,7 @@ void CL_Disconnect(void)
                sizebuf_t buf;
                unsigned char bufdata[8];
                if (cls.demorecording)
-                       CL_Stop_f(&cmd_client);
+                       CL_Stop_f(cmd_client);
 
                // send disconnect message 3 times to improve chances of server
                // receiving it (but it still fails sometimes)
@@ -553,8 +553,8 @@ void CL_EstablishConnection(const char *address, int firstarg)
                {
                        int i;
                        *cls.connect_userinfo = 0;
-                       for(i = firstarg; i+2 <= Cmd_Argc(&cmd_client); i += 2)
-                               InfoString_SetValue(cls.connect_userinfo, sizeof(cls.connect_userinfo), Cmd_Argv(&cmd_client, i), Cmd_Argv(&cmd_client, i+1));
+                       for(i = firstarg; i+2 <= Cmd_Argc(cmd_client); i += 2)
+                               InfoString_SetValue(cls.connect_userinfo, sizeof(cls.connect_userinfo), Cmd_Argv(cmd_client, i), Cmd_Argv(cmd_client, i+1));
                }
                else if(firstarg < -1)
                {
@@ -2728,6 +2728,21 @@ void CL_UpdateEntityShading(void)
                CL_UpdateEntityShading_Entity(r_refdef.scene.entities[i]);
 }
 
+qbool vid_opened = false;
+void CL_StartVideo(void)
+{
+       if (!vid_opened && cls.state != ca_dedicated)
+       {
+               vid_opened = true;
+#ifdef WIN32
+               // make sure we open sockets before opening video because the Windows Firewall "unblock?" dialog can screw up the graphics context on some graphics drivers
+               NetConn_UpdateSockets();
+#endif
+               VID_Start();
+               CDAudio_Startup();
+       }
+}
+
 extern cvar_t host_framerate;
 extern cvar_t host_speeds;