Browse Source

Add Sys_GetIntFromCmdLine

pull/2/head
Alibek Omarov 7 years ago
parent
commit
b70fab5384
  1. 16
      engine/common/system.c

16
engine/common/system.c

@ -400,7 +400,7 @@ Sys_GetParmFromCmdLine
Returns the argument for specified parm Returns the argument for specified parm
================ ================
*/ */
qboolean _Sys_GetParmFromCmdLine( char *parm, char *out, size_t size ) qboolean _Sys_GetParmFromCmdLine( const char *parm, char *out, size_t size )
{ {
int argc = Sys_CheckParm( parm ); int argc = Sys_CheckParm( parm );
@ -412,6 +412,20 @@ qboolean _Sys_GetParmFromCmdLine( char *parm, char *out, size_t size )
return true; return true;
} }
qboolean Sys_GetIntFromCmdLine( const char* argName, int *out )
{
int argIndex = Sys_CheckParm( argName );
if( argIndex < 1 || argIndex + 1 >= host.argc || !host.argv[argIndex + 1] )
{
*out = 0;
return false;
}
*out = Q_atoi( host.argv[argIndex + 1] );
return true;
}
void Sys_SendKeyEvents( void ) void Sys_SendKeyEvents( void )
{ {
#ifdef _WIN32 #ifdef _WIN32

Loading…
Cancel
Save