diff options
Diffstat (limited to 'src/qcommon')
| -rw-r--r-- | src/qcommon/common.c | 1 | ||||
| -rw-r--r-- | src/qcommon/cvar.c | 24 | ||||
| -rw-r--r-- | src/qcommon/q_shared.h | 1 | ||||
| -rw-r--r-- | src/qcommon/qcommon.h | 1 | 
4 files changed, 27 insertions, 0 deletions
diff --git a/src/qcommon/common.c b/src/qcommon/common.c index d8216b15..74df47ba 100644 --- a/src/qcommon/common.c +++ b/src/qcommon/common.c @@ -1533,6 +1533,7 @@ void Com_InitHunkMemory( void ) {  	// allocate the stack based hunk allocator  	cv = Cvar_Get( "com_hunkMegs", DEF_COMHUNKMEGS_S, CVAR_LATCH | CVAR_ARCHIVE ); +	Cvar_SetDescription(cv, "The size of the hunk memory segment");  	// if we are not dedicated min allocation is 56, otherwise min is 1  	if (com_dedicated && com_dedicated->integer) { diff --git a/src/qcommon/cvar.c b/src/qcommon/cvar.c index 93ab6ae8..336f45b0 100644 --- a/src/qcommon/cvar.c +++ b/src/qcommon/cvar.c @@ -439,6 +439,7 @@ cvar_t *Cvar_Get( const char *var_name, const char *var_value, int flags ) {  	var->integer = atoi(var->string);  	var->resetString = CopyString( var_value );  	var->validate = qfalse; +	var->description = NULL;  	// link the variable in  	var->next = cvar_vars; @@ -490,6 +491,10 @@ void Cvar_Print( cvar_t *v ) {  	if ( v->latchedString ) {  		Com_Printf( "latched: \"%s\"\n", v->latchedString );  	} + +	if ( v->description ) { +		Com_Printf( "%s\n", v->description ); +	}  }  /* @@ -1121,6 +1126,8 @@ cvar_t *Cvar_Unset(cvar_t *cv)  		Z_Free(cv->latchedString);  	if(cv->resetString)  		Z_Free(cv->resetString); +	if(cv->description) +		Z_Free(cv->description);  	if(cv->prev)  		cv->prev->next = cv->next; @@ -1292,6 +1299,23 @@ void Cvar_CheckRange( cvar_t *var, float min, float max, qboolean integral )  /*  ===================== +Cvar_SetDescription +===================== +*/ +void Cvar_SetDescription( cvar_t *var, const char *var_description ) +{ +	if( var_description && var_description[0] != '\0' ) +	{ +		if( var->description != NULL ) +		{ +			Z_Free( var->description ); +		} +		var->description = CopyString( var_description ); +	} +} + +/* +=====================  Cvar_Register  basically a slightly modified Cvar_Get for the interpreted modules diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h index 9de2d8f2..259300ed 100644 --- a/src/qcommon/q_shared.h +++ b/src/qcommon/q_shared.h @@ -979,6 +979,7 @@ struct cvar_s {  	qboolean	integral;  	float			min;  	float			max; +	char			*description;  	cvar_t *next;  	cvar_t *prev; diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h index 5ee2c7c9..98d1f1ec 100644 --- a/src/qcommon/qcommon.h +++ b/src/qcommon/qcommon.h @@ -544,6 +544,7 @@ char	*Cvar_InfoString_Big( int bit );  // in their flags ( CVAR_USERINFO, CVAR_SERVERINFO, CVAR_SYSTEMINFO, etc )  void	Cvar_InfoStringBuffer( int bit, char *buff, int buffsize );  void Cvar_CheckRange( cvar_t *cv, float minVal, float maxVal, qboolean shouldBeIntegral ); +void Cvar_SetDescription( cvar_t *var, const char *var_description );  void	Cvar_Restart(qboolean unsetVM);  void	Cvar_Restart_f( void );  | 
