Browse Source

engine: common: cmd: add Cbuf_AddTextf wrapper

pull/2/head
Alibek Omarov 2 years ago
parent
commit
b12b2aaf79
  1. 12
      engine/common/cmd.c
  2. 1
      engine/common/common.h

12
engine/common/cmd.c

@ -120,6 +120,18 @@ void Cbuf_AddText( const char *text ) @@ -120,6 +120,18 @@ void Cbuf_AddText( const char *text )
Cbuf_AddTextToBuffer( &cmd_text, text );
}
void Cbuf_AddTextf( const char *fmt, ... )
{
va_list va;
char buf[MAX_VA_STRING];
va_start( va, fmt );
Q_vsnprintf( buf, sizeof( buf ), fmt, va );
va_end( va );
Cbuf_AddText( buf );
}
/*
============
Cbuf_AddFilteredText

1
engine/common/common.h

@ -425,6 +425,7 @@ void FS_Shutdown( void ); @@ -425,6 +425,7 @@ void FS_Shutdown( void );
void Cbuf_Init( void );
void Cbuf_Clear( void );
void Cbuf_AddText( const char *text );
void Cbuf_AddTextf( const char *text, ... ) _format( 1 );
void Cbuf_AddFilteredText( const char *text );
void Cbuf_InsertText( const char *text );
void Cbuf_ExecStuffCmds( void );

Loading…
Cancel
Save