mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-10 23:27:53 +00:00
Add Sys_GetIntFromCmdLine
This commit is contained in:
parent
92c321848d
commit
b70fab5384
@ -400,7 +400,7 @@ Sys_GetParmFromCmdLine
|
||||
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 );
|
||||
|
||||
@ -412,6 +412,20 @@ qboolean _Sys_GetParmFromCmdLine( char *parm, char *out, size_t size )
|
||||
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 )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
Loading…
Reference in New Issue
Block a user