]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - host.c
Start video _during_ initialization, rather than when finding a model
[xonotic/darkplaces.git] / host.c
diff --git a/host.c b/host.c
index 78b87dde59ac03ab9ef6972bfc7b5aa57cd51cf5..313745a977e9d72b45d93f01a71bebf3e449362e 100644 (file)
--- a/host.c
+++ b/host.c
@@ -129,7 +129,7 @@ void Host_Error (const char *error, ...)
        dpvsnprintf (hosterrorstring1,sizeof(hosterrorstring1),error,argptr);
        va_end (argptr);
 
-       Con_Printf("Host_Error: %s\n", hosterrorstring1);
+       Con_Errorf("Host_Error: %s\n", hosterrorstring1);
 
        // LadyHavoc: if crashing very early, or currently shutting down, do
        // Sys_Error instead
@@ -290,7 +290,7 @@ static void Host_SaveConfig_to(const char *file)
                f = FS_OpenRealFile(file, "wb", false);
                if (!f)
                {
-                       Con_Printf("Couldn't write %s.\n", file);
+                       Con_Errorf("Couldn't write %s.\n", file);
                        return;
                }
 
@@ -696,12 +696,12 @@ void Host_Main(void)
                {
                        // warn if it's significant
                        if (deltacleantime < -0.01)
-                               Con_Printf("Host_Mingled: time stepped backwards (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
+                               Con_Warnf("Host_Mingled: time stepped backwards (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
                        deltacleantime = 0;
                }
                else if (deltacleantime >= 1800)
                {
-                       Con_Printf("Host_Mingled: time stepped forward (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
+                       Con_Warnf("Host_Mingled: time stepped forward (went from %f to %f, difference %f)\n", olddirtytime, dirtytime, deltacleantime);
                        deltacleantime = 0;
                }
                realtime += deltacleantime;
@@ -781,8 +781,15 @@ void Host_Main(void)
                        // process console commands
 //                     R_TimeReport("preconsole");
                        CL_VM_PreventInformationLeaks();
+                       Cbuf_Frame(&cmd_clientfromserver);
                        Cbuf_Frame(&cmd_client);
                        Cbuf_Frame(&cmd_server);
+
+                       if(sv.active)
+                       {
+                               Cbuf_Frame(&cmd_serverfromclient);
+                       }
+
 //                     R_TimeReport("console");
                }
 
@@ -1025,7 +1032,6 @@ void Host_Main(void)
                        R_TimeReport("client");
 
                        CL_UpdateScreen();
-                       CL_MeshEntities_Reset();
                        R_TimeReport("render");
 
                        if (host_speeds.integer)
@@ -1131,7 +1137,7 @@ void Host_LockSession(void)
                {
                        if(locksession.integer == 2)
                        {
-                               Con_Printf("WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p);
+                               Con_Warnf("WARNING: session lock %s could not be acquired. Please run with -sessionid and an unique session name. Continuing anyway.\n", p);
                        }
                        else
                        {
@@ -1156,6 +1162,8 @@ void Host_UnlockSession(void)
        }
 }
 
+extern hook_t *csqc_concmd;
+
 /*
 ====================
 Host_Init
@@ -1223,6 +1231,8 @@ static void Host_Init (void)
        // initialize memory subsystem cvars/commands
        Memory_Init_Commands();
 
+       Hook_Init();
+       csqc_concmd = Hook_Register(csqc_concmd,CL_VM_ConsoleCommand,1);
        // initialize console and logging and its cvars/commands
        Con_Init();
 
@@ -1324,6 +1334,11 @@ static void Host_Init (void)
                Cbuf_Execute(cmd);
        }
 
+       Log_Start();
+       
+       // Starting after we parse commands so the screen resolution doesn't get weird for the first few seconds
+       Host_StartVideo();
+       
        // put up the loading image so the user doesn't stare at a black screen...
        SCR_BeginLoadingPlaque(true);