]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
glossmap textures are now brighter (no change to forced gloss brightness)
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 42dca46c48112363dcabc8124e198c1125fa47e0..7233970b719aaa728dcc2493a4f23c36fcb702f1 100644 (file)
--- a/host.c
+++ b/host.c
@@ -462,7 +462,7 @@ void SV_DropClient (qboolean crash)
                MSG_WriteByte (&client->message, 0);
        }
 
-       NET_Heartbeat ();
+       NET_Heartbeat (1);
 }
 
 /*
@@ -490,8 +490,8 @@ void Host_ShutdownServer(qboolean crash)
 // stop all client sounds immediately
        CL_Disconnect ();
 
-       NET_Heartbeat ();
-       NET_Heartbeat ();
+       NET_Heartbeat (2);
+       NET_Heartbeat (2);
 
 // flush any pending messages - like the score!!!
        start = Sys_DoubleTime();
@@ -687,6 +687,9 @@ void Host_ServerFrame (void)
 
 // send all messages to the clients
        SV_SendClientMessages ();
+
+// send an heartbeat if enough time has passed since the last one
+       NET_Heartbeat (0);
 }
 
 
@@ -727,6 +730,9 @@ void _Host_Frame (float time)
 // process console commands
        Cbuf_Execute ();
 
+       // LordHavoc: map and load are delayed until video is initialized
+       Host_PerformSpawnServerAndLoadGame();
+
        NET_Poll();
 
 // if running the server locally, make intentions now
@@ -881,42 +887,29 @@ void Host_Init (void)
 
        if (cls.state != ca_dedicated)
        {
-               VID_InitCvars();
-
                Gamma_Init();
-
                Palette_Init();
-
-#ifndef _WIN32 // on non win32, mouse comes before video for security reasons
-               IN_Init ();
-#endif
+               VID_Shared_Init();
                VID_Init();
-               if (!VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, vid_bitsperpixel.integer))
-               {
-                       if (vid_fullscreen.integer)
-                       {
-                               if (!VID_Mode(true, 640, 480, 16))
-                                       if (!VID_Mode(false, 640, 480, 16))
-                                               Sys_Error("Video modes failed\n");
-                       }
-                       else
-                               Sys_Error("Requested windowed video mode failed\n");
-               }
 
                Render_Init();
                S_Init ();
                CDAudio_Init ();
                CL_Init ();
-#ifdef _WIN32 // on non win32, mouse comes before video for security reasons
-               IN_Init ();
-#endif
        }
 
        Cbuf_InsertText ("exec quake.rc\n");
+       Cbuf_Execute ();
+       Cbuf_Execute ();
+       Cbuf_Execute ();
+       Cbuf_Execute ();
 
        host_initialized = true;
        
-       Sys_Printf ("========Quake Initialized=========\n");    
+       Con_Printf ("========Quake Initialized=========\n");    
+
+       if (cls.state != ca_dedicated)
+               VID_Open();
 }
 
 
@@ -944,7 +937,6 @@ void Host_Shutdown(void)
        CDAudio_Shutdown ();
        NET_Shutdown ();
        S_Shutdown();
-       IN_Shutdown ();
 
        if (cls.state != ca_dedicated)
        {