X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=cl_main.c;h=2a2b9976d204dd82cc6e41bf67c9c3e1b1e6cf50;hb=0b5e8b49f3ed65b746481dc175d67daf0c48a830;hp=d758cec83fab938b79cb1f7f504e96d1f965fcb3;hpb=feb22f39c2c1a481b8c7a2364767b6402d5d94a1;p=xonotic%2Fdarkplaces.git diff --git a/cl_main.c b/cl_main.c index d758cec8..2a2b9976 100644 --- a/cl_main.c +++ b/cl_main.c @@ -340,6 +340,16 @@ void CL_ExpandCSQCRenderEntities(int num) } } +static void CL_ToggleMenu_Hook(void) +{ +#ifdef CONFIG_MENU + // remove menu + if (key_dest == key_menu || key_dest == key_menu_grabbed) + MR_ToggleMenu(0); +#endif + key_dest = key_game; +} + extern cvar_t rcon_secure; /* @@ -2718,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; @@ -3060,6 +3085,8 @@ void CL_Init (void) CL_Video_Init(); host.hook.ConnectLocal = CL_EstablishConnection_Local; + host.hook.Disconnect = CL_Disconnect; host.hook.CL_Intermission = CL_Intermission; + host.hook.ToggleMenu = CL_ToggleMenu_Hook; } }