mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-03-13 06:21:08 +00:00
engine: common: add printf-like version of Cvar_Get function.
This commit is contained in:
parent
573781b45d
commit
a2d459ae84
@ -469,6 +469,23 @@ convar_t *Cvar_Get( const char *name, const char *value, int flags, const char *
|
||||
return var;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_Getf
|
||||
============
|
||||
*/
|
||||
convar_t *Cvar_Getf( const char *var_name, int flags, const char *description, const char *format, ... )
|
||||
{
|
||||
char value[MAX_VA_STRING];
|
||||
va_list args;
|
||||
|
||||
va_start( args, format );
|
||||
Q_vsnprintf( value, sizeof( value ), format, args );
|
||||
va_end( args );
|
||||
|
||||
return Cvar_Get( var_name, value, flags, description );
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
Cvar_RegisterVariable
|
||||
|
@ -63,6 +63,7 @@ cvar_t *Cvar_GetList( void );
|
||||
convar_t *Cvar_FindVarExt( const char *var_name, int ignore_group );
|
||||
void Cvar_RegisterVariable( convar_t *var );
|
||||
convar_t *Cvar_Get( const char *var_name, const char *value, int flags, const char *description );
|
||||
convar_t *Cvar_Getf( const char *var_name, int flags, const char *description, const char *format, ... ) _format( 4 );
|
||||
void Cvar_LookupVars( int checkbit, void *buffer, void *ptr, setpair_t callback );
|
||||
void Cvar_FullSet( const char *var_name, const char *value, int flags );
|
||||
void Cvar_DirectSet( convar_t *var, const char *value );
|
||||
|
Loading…
x
Reference in New Issue
Block a user