From 9da42b11e03447a6d0b67b054be2e1f92a4dec8f Mon Sep 17 00:00:00 2001 From: icculus Date: Mon, 14 Sep 2009 19:28:59 +0000 Subject: Minor reworking to check command line cvars before Com_InitZoneMemory(). This lets you set com_zoneMegs from the command line (although still not from a config file, but oh well). Fixes Bugzilla #2571. git-svn-id: svn://svn.icculus.org/quake3/trunk@1590 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/common.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'code/qcommon') diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 75e5f80..f0a341b 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -1397,9 +1397,11 @@ void Com_InitSmallZoneMemory( void ) { void Com_InitZoneMemory( void ) { cvar_t *cv; - //FIXME: 05/01/06 com_zoneMegs is useless right now as neither q3config.cfg nor - // Com_StartupVariable have been executed by this point. The net result is that - // s_zoneTotal will always be set to the default value. + // Please note: com_zoneMegs can only be set on the command line, and + // not in q3config.cfg or Com_StartupVariable, as they haven't been + // executed by this point. It's a chicken and egg problem. We need the + // memory manager configured to handle those places where you would + // configure the memory manager. // allocate the random block zone cv = Cvar_Get( "com_zoneMegs", DEF_COMZONEMEGS_S, CVAR_LATCH | CVAR_ARCHIVE ); @@ -2550,12 +2552,12 @@ void Com_Init( char *commandLine ) { // Swap_Init (); Cbuf_Init (); - Com_InitZoneMemory(); - Cmd_Init (); - // override anything from the config files with command line args Com_StartupVariable( NULL ); + Com_InitZoneMemory(); + Cmd_Init (); + // get the developer cvar set as early as possible Com_StartupVariable( "developer" ); -- cgit v1.2.3