]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
moved Log_Start call into SCR_BeginLoadingPlaque (which occurs as soon as a map or...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 11 Mar 2006 16:19:18 +0000 (16:19 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 11 Mar 2006 16:19:18 +0000 (16:19 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6095 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
console.c
host.c

index 74cfdc69950df707761a0f7415701a32ff8172f4..861f181dcc5ff5cf45253cbbc436e1e4986334af 100644 (file)
@@ -488,6 +488,9 @@ SCR_BeginLoadingPlaque
 */
 void SCR_BeginLoadingPlaque (void)
 {
+       // save console log up to this point to log_file if it was set by configs
+       Log_Start();
+
        Host_StartVideo();
        S_StopAllSounds();
        SCR_UpdateLoadingScreen();
index 5c798f56f2c77a882260abd38d7bff8ced006c58..9c92e8163fa892540e5663a87afc8809a6b409dc 100644 (file)
--- a/console.c
+++ b/console.c
@@ -153,10 +153,11 @@ void Log_Start (void)
        // Dump the contents of the log queue into the log file and free it
        if (logqueue != NULL)
        {
-               if (logfile != NULL && logq_ind != 0)
-                       FS_Write (logfile, logqueue, logq_ind);
-               Mem_Free (logqueue);
+               unsigned char *temp = logqueue;
                logqueue = NULL;
+               if (logfile != NULL && logq_ind != 0)
+                       FS_Write (logfile, temp, logq_ind);
+               Mem_Free (temp);
                logq_ind = 0;
                logq_size = 0;
        }
@@ -392,7 +393,7 @@ void Con_Init (void)
        con_linewidth = 80;
        con_totallines = CON_TEXTSIZE / con_linewidth;
 
-       // Allocate a log queue
+       // Allocate a log queue, this will be freed after configs are parsed
        logq_size = MAX_INPUTLINE;
        logqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size);
        logq_ind = 0;
diff --git a/host.c b/host.c
index 3cf4f493900412ecf165a4a1148e323a43bea777..d9b4da4abf5cfc875f1ddb01004811da8d3e77a8 100644 (file)
--- a/host.c
+++ b/host.c
@@ -1030,9 +1030,6 @@ void Host_Init (void)
                Cbuf_Execute();
        }
 
-       // save console log up to this point to log_file if it was set by configs
-       Log_Start();
-
        // put up the loading image so the user doesn't stare at a black screen...
        SCR_BeginLoadingPlaque();