From a95a5849f03a278febc784cf588b733fb24f5e86 Mon Sep 17 00:00:00 2001 From: havoc Date: Fri, 23 May 2003 07:38:25 +0000 Subject: [PATCH] console logging (-condebug) now starts earlier in the startup process (just after the filesystem) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3018 d7cf8633-e32d-0410-b094-e92efae38249 --- common.c | 1 + console.c | 19 +++++++++++-------- console.h | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/common.c b/common.c index 4d9c9d55..8987d7f3 100644 --- a/common.c +++ b/common.c @@ -767,6 +767,7 @@ void COM_Init (void) Mathlib_Init(); FS_Init (); + Con_InitLogging(); COM_CheckRegistered (); COM_InitGameType(); diff --git a/console.c b/console.c index 21148248..34ff0a48 100644 --- a/console.c +++ b/console.c @@ -201,20 +201,13 @@ void Con_CheckResize (void) } -/* -================ -Con_Init -================ -*/ -void Con_Init (void) +void Con_InitLogging (void) { #define MAXGAMEDIRLEN 1000 char temp[MAXGAMEDIRLEN+1]; char *t2 = "/qconsole.log"; - Cvar_RegisterVariable(&logfile); con_debuglog = COM_CheckParm("-condebug"); - if (con_debuglog) { if (strlen (fs_gamedir) < (MAXGAMEDIRLEN - strlen (t2))) @@ -224,6 +217,16 @@ void Con_Init (void) } logfile.integer = 1; } +} + +/* +================ +Con_Init +================ +*/ +void Con_Init (void) +{ + Cvar_RegisterVariable(&logfile); console_mempool = Mem_AllocPool("console"); con_text = Mem_Alloc(console_mempool, CON_TEXTSIZE); diff --git a/console.h b/console.h index 9042ac06..d6aec97c 100644 --- a/console.h +++ b/console.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -31,6 +31,7 @@ extern qbyte *con_chars; extern int con_notifylines; // scan lines to clear for notify lines void Con_CheckResize (void); +void Con_InitLogging (void); void Con_Init (void); void Con_DrawConsole (int lines); void Con_Print (const char *txt); -- 2.39.2