mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-11 07:37:52 +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
|
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…
Reference in New Issue
Block a user