本文整理汇总了C++中Cvar_Update函数的典型用法代码示例。如果您正苦于以下问题:C++ Cvar_Update函数的具体用法?C++ Cvar_Update怎么用?C++ Cvar_Update使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Cvar_Update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: G_UpdateCvars
/*
=================
G_UpdateCvars
=================
*/
void G_UpdateCvars()
{
int i;
cvarTable_t *cv;
bool remapped = false;
for( i = 0, cv = gameCvarTable ; i < gameCvarTableSize ; i++, cv++ )
{
if( cv->vmCvar )
{
Cvar_Update( cv->vmCvar );
if( cv->modificationCount != cv->vmCvar->modificationCount )
{
cv->modificationCount = cv->vmCvar->modificationCount;
if( cv->trackChange )
{
SV_GameSendServerCommand( -1, va("print \"Server: %s changed to %s\n\"",
cv->cvarName, cv->vmCvar->string ) );
}
if( cv->teamShader )
remapped = true;
}
}
}
if( remapped )
G_RemapTeamShaders();
}
示例2: Cvar_Register
void Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags )
{
cvar_t* cv = Cvar_Get( varName, defaultValue, flags );
if ( !vmCvar )
return;
vmCvar->handle = cv - cvar_indexes;
vmCvar->modificationCount = -1;
Cvar_Update( vmCvar );
}
示例3: Cvar_Register
/*
=====================
Cvar_Register
basically a slightly modified Cvar_Get for the interpreted modules
=====================
*/
void Cvar_Register(vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags)
{
cvar_t *cv;
// There is code in Cvar_Get to prevent CVAR_ROM cvars being changed by the
// user. In other words CVAR_ARCHIVE and CVAR_ROM are mutually exclusive
// flags. Unfortunately some historical game code (including single player
// baseq3) sets both flags. We unset CVAR_ROM for such cvars.
if ((flags & (CVAR_ARCHIVE | CVAR_ROM)) == (CVAR_ARCHIVE | CVAR_ROM)) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: Unsetting CVAR_ROM from cvar '%s', "
"since it is also CVAR_ARCHIVE\n", varName );
flags &= ~CVAR_ROM;
}
// Don't allow VM to specific a different creator or other internal flags.
if ( flags & CVAR_USER_CREATED ) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_USER_CREATED on cvar '%s'\n", varName );
flags &= ~CVAR_USER_CREATED;
}
if ( flags & CVAR_SERVER_CREATED ) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_SERVER_CREATED on cvar '%s'\n", varName );
flags &= ~CVAR_SERVER_CREATED;
}
if ( flags & CVAR_PROTECTED ) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_PROTECTED on cvar '%s'\n", varName );
flags &= ~CVAR_PROTECTED;
}
if ( flags & CVAR_MODIFIED ) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_MODIFIED on cvar '%s'\n", varName );
flags &= ~CVAR_MODIFIED;
}
if ( flags & CVAR_NONEXISTENT ) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to set CVAR_NONEXISTENT on cvar '%s'\n", varName );
flags &= ~CVAR_NONEXISTENT;
}
cv = Cvar_FindVar(varName);
// Don't modify cvar if it's protected.
if ( cv && ( cv->flags & CVAR_PROTECTED ) ) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: VM tried to register protected cvar '%s' with value '%s'%s\n",
varName, defaultValue, ( flags & ~cv->flags ) != 0 ? " and new flags" : "" );
} else {
cv = Cvar_Get(varName, defaultValue, flags | CVAR_VM_CREATED);
}
if (!vmCvar)
return;
vmCvar->handle = cv - cvar_indexes;
vmCvar->modificationCount = -1;
Cvar_Update( vmCvar );
}
示例4: Cvar_Register
void Cvar_Register(vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags) {
// if the cvar was created by a script, it won't have the correct flags
cvar_t* cv = Cvar_Get(varName, defaultValue, flags);
if (!vmCvar) {
return;
}
if (cv->index == -1) {
cv->index = vmCvarTable.size();
vmCvarTable.push_back(cv);
}
vmCvar->handle = cv->index;
vmCvar->modificationCount = -1;
Cvar_Update(vmCvar);
}
示例5: Cvar_Register
/*
=====================
Cvar_Register
basically a slightly modified Cvar_Get for the interpreted modules
=====================
*/
void Cvar_Register( vmCvar_t *vmCvar, const char *varName, const char *defaultValue, uint32_t flags ) {
cvar_t *cv;
// There is code in Cvar_Get to prevent CVAR_ROM cvars being changed by the user. In other words CVAR_ARCHIVE and
// CVAR_ROM are mutually exclusive flags. Unfortunately some historical game code (including single player baseq3)
// sets both flags. We unset CVAR_ROM for such cvars.
if ((flags & (CVAR_ARCHIVE | CVAR_ROM)) == (CVAR_ARCHIVE | CVAR_ROM)) {
Com_DPrintf( S_COLOR_YELLOW "WARNING: Unsetting CVAR_ROM cvar '%s', since it is also CVAR_ARCHIVE\n", varName );
flags &= ~CVAR_ROM;
}
cv = Cvar_Get( varName, defaultValue, flags | CVAR_VM_CREATED );
if ( !vmCvar ) {
return;
}
vmCvar->handle = cv - cvar_indexes;
vmCvar->modificationCount = -1;
Cvar_Update( vmCvar );
}
示例6: CLWM_UISystemCalls
// The ui module is making a system call
qintptr CLWM_UISystemCalls( qintptr* args ) {
switch ( args[ 0 ] ) {
case WMUI_ERROR:
common->Error( "%s", ( char* )VMA( 1 ) );
return 0;
case WMUI_PRINT:
common->Printf( "%s", ( char* )VMA( 1 ) );
return 0;
case WMUI_MILLISECONDS:
return Sys_Milliseconds();
case WMUI_CVAR_REGISTER:
Cvar_Register( ( vmCvar_t* )VMA( 1 ), ( char* )VMA( 2 ), ( char* )VMA( 3 ), args[ 4 ] );
return 0;
case WMUI_CVAR_UPDATE:
Cvar_Update( ( vmCvar_t* )VMA( 1 ) );
return 0;
case WMUI_CVAR_SET:
Cvar_Set( ( char* )VMA( 1 ), ( char* )VMA( 2 ) );
return 0;
case WMUI_CVAR_VARIABLEVALUE:
return FloatAsInt( Cvar_VariableValue( ( char* )VMA( 1 ) ) );
case WMUI_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( ( char* )VMA( 1 ), ( char* )VMA( 2 ), args[ 3 ] );
return 0;
case WMUI_CVAR_SETVALUE:
Cvar_SetValue( ( char* )VMA( 1 ), VMF( 2 ) );
return 0;
case WMUI_CVAR_RESET:
Cvar_Reset( ( char* )VMA( 1 ) );
return 0;
case WMUI_CVAR_CREATE:
Cvar_Get( ( char* )VMA( 1 ), ( char* )VMA( 2 ), args[ 3 ] );
return 0;
case WMUI_CVAR_INFOSTRINGBUFFER:
Cvar_InfoStringBuffer( args[ 1 ], MAX_INFO_STRING_Q3, ( char* )VMA( 2 ), args[ 3 ] );
return 0;
case WMUI_ARGC:
return Cmd_Argc();
case WMUI_ARGV:
Cmd_ArgvBuffer( args[ 1 ], ( char* )VMA( 2 ), args[ 3 ] );
return 0;
case WMUI_CMD_EXECUTETEXT:
Cbuf_ExecuteText( args[ 1 ], ( char* )VMA( 2 ) );
return 0;
case WMUI_FS_FOPENFILE:
return FS_FOpenFileByMode( ( char* )VMA( 1 ), ( fileHandle_t* )VMA( 2 ), ( fsMode_t )args[ 3 ] );
case WMUI_FS_READ:
FS_Read( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case WMUI_FS_WRITE:
FS_Write( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case WMUI_FS_FCLOSEFILE:
FS_FCloseFile( args[ 1 ] );
return 0;
case WMUI_FS_DELETEFILE:
return FS_Delete( ( char* )VMA( 1 ) );
case WMUI_FS_GETFILELIST:
return FS_GetFileList( ( char* )VMA( 1 ), ( char* )VMA( 2 ), ( char* )VMA( 3 ), args[ 4 ] );
case WMUI_R_REGISTERMODEL:
return R_RegisterModel( ( char* )VMA( 1 ) );
case WMUI_R_REGISTERSKIN:
return R_RegisterSkin( ( char* )VMA( 1 ) );
case WMUI_R_REGISTERSHADERNOMIP:
return R_RegisterShaderNoMip( ( char* )VMA( 1 ) );
case WMUI_R_CLEARSCENE:
R_ClearScene();
return 0;
case WMUI_R_ADDREFENTITYTOSCENE:
CLWM_AddRefEntityToScene( ( wmrefEntity_t* )VMA( 1 ) );
return 0;
case WMUI_R_ADDPOLYTOSCENE:
R_AddPolyToScene( args[ 1 ], args[ 2 ], ( polyVert_t* )VMA( 3 ), 1 );
//.........这里部分代码省略.........
示例7: CLWS_CgameSystemCalls
// The cgame module is making a system call
qintptr CLWS_CgameSystemCalls( qintptr* args ) {
switch ( args[ 0 ] ) {
case WSCG_PRINT:
common->Printf( "%s", ( char* )VMA( 1 ) );
return 0;
case WSCG_ERROR:
common->Error( "%s", ( char* )VMA( 1 ) );
return 0;
case WSCG_MILLISECONDS:
return Sys_Milliseconds();
case WSCG_CVAR_REGISTER:
Cvar_Register( ( vmCvar_t* )VMA( 1 ), ( char* )VMA( 2 ), ( char* )VMA( 3 ), args[ 4 ] );
return 0;
case WSCG_CVAR_UPDATE:
Cvar_Update( ( vmCvar_t* )VMA( 1 ) );
return 0;
case WSCG_CVAR_SET:
Cvar_Set( ( char* )VMA( 1 ), ( char* )VMA( 2 ) );
return 0;
case WSCG_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( ( char* )VMA( 1 ), ( char* )VMA( 2 ), args[ 3 ] );
return 0;
case WSCG_ARGC:
return Cmd_Argc();
case WSCG_ARGV:
Cmd_ArgvBuffer( args[ 1 ], ( char* )VMA( 2 ), args[ 3 ] );
return 0;
case WSCG_ARGS:
Cmd_ArgsBuffer( ( char* )VMA( 1 ), args[ 2 ] );
return 0;
case WSCG_FS_FOPENFILE:
return FS_FOpenFileByMode( ( char* )VMA( 1 ), ( fileHandle_t* )VMA( 2 ), ( fsMode_t )args[ 3 ] );
case WSCG_FS_READ:
FS_Read( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case WSCG_FS_WRITE:
return FS_Write( VMA( 1 ), args[ 2 ], args[ 3 ] );
case WSCG_FS_FCLOSEFILE:
FS_FCloseFile( args[ 1 ] );
return 0;
case WSCG_SENDCONSOLECOMMAND:
Cbuf_AddText( ( char* )VMA( 1 ) );
return 0;
case WSCG_ADDCOMMAND:
CLT3_AddCgameCommand( ( char* )VMA( 1 ) );
return 0;
case WSCG_REMOVECOMMAND:
Cmd_RemoveCommand( ( char* )VMA( 1 ) );
return 0;
case WSCG_SENDCLIENTCOMMAND:
CL_AddReliableCommand( ( char* )VMA( 1 ) );
return 0;
case WSCG_UPDATESCREEN:
SCR_UpdateScreen();
return 0;
case WSCG_CM_LOADMAP:
CLT3_CM_LoadMap( ( char* )VMA( 1 ) );
return 0;
case WSCG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case WSCG_CM_INLINEMODEL:
return CM_InlineModel( args[ 1 ] );
case WSCG_CM_TEMPBOXMODEL:
return CM_TempBoxModel( ( float* )VMA( 1 ), ( float* )VMA( 2 ), false );
case WSCG_CM_TEMPCAPSULEMODEL:
return CM_TempBoxModel( ( float* )VMA( 1 ), ( float* )VMA( 2 ), true );
case WSCG_CM_POINTCONTENTS:
return CM_PointContentsQ3( ( float* )VMA( 1 ), args[ 2 ] );
case WSCG_CM_TRANSFORMEDPOINTCONTENTS:
return CM_TransformedPointContentsQ3( ( float* )VMA( 1 ), args[ 2 ], ( float* )VMA( 3 ), ( float* )VMA( 4 ) );
case WSCG_CM_BOXTRACE:
CM_BoxTraceQ3( ( q3trace_t* )VMA( 1 ), ( float* )VMA( 2 ), ( float* )VMA( 3 ), ( float* )VMA( 4 ), ( float* )VMA( 5 ), args[ 6 ], args[ 7 ], false );
return 0;
case WSCG_CM_TRANSFORMEDBOXTRACE:
CM_TransformedBoxTraceQ3( ( q3trace_t* )VMA( 1 ), ( float* )VMA( 2 ), ( float* )VMA( 3 ), ( float* )VMA( 4 ), ( float* )VMA( 5 ), args[ 6 ], args[ 7 ], ( float* )VMA( 8 ), ( float* )VMA( 9 ), false );
return 0;
case WSCG_CM_CAPSULETRACE:
CM_BoxTraceQ3( ( q3trace_t* )VMA( 1 ), ( float* )VMA( 2 ), ( float* )VMA( 3 ), ( float* )VMA( 4 ), ( float* )VMA( 5 ), args[ 6 ], args[ 7 ], true );
return 0;
case WSCG_CM_TRANSFORMEDCAPSULETRACE:
CM_TransformedBoxTraceQ3( ( q3trace_t* )VMA( 1 ), ( float* )VMA( 2 ), ( float* )VMA( 3 ), ( float* )VMA( 4 ), ( float* )VMA( 5 ), args[ 6 ], args[ 7 ], ( float* )VMA( 8 ), ( float* )VMA( 9 ), true );
return 0;
case WSCG_CM_MARKFRAGMENTS:
return R_MarkFragmentsWolf( args[ 1 ], ( const vec3_t* )VMA( 2 ), ( float* )VMA( 3 ), args[ 4 ], ( float* )VMA( 5 ), args[ 6 ], ( markFragment_t* )VMA( 7 ) );
case WSCG_S_STARTSOUND:
S_StartSound( ( float* )VMA( 1 ), args[ 2 ], args[ 3 ], args[ 4 ], 0.5 );
return 0;
case WSCG_S_STARTSOUNDEX:
S_StartSoundEx( ( float* )VMA( 1 ), args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ], 127 );
return 0;
case WSCG_S_STARTLOCALSOUND:
S_StartLocalSound( args[ 1 ], args[ 2 ], 127 );
return 0;
case WSCG_S_CLEARLOOPINGSOUNDS:
CLWS_ClearLoopingSounds( args[ 1 ] );
return 0;
case WSCG_S_ADDLOOPINGSOUND:
// FIXME MrE: handling of looping sounds changed
S_AddLoopingSound( args[ 1 ], ( float* )VMA( 2 ), ( float* )VMA( 3 ), args[ 4 ], args[ 5 ], args[ 6 ], 0 );
//.........这里部分代码省略.........
示例8: CL_CgameSystemCalls
/*
====================
CL_CgameSystemCalls
The cgame module is making a system call
====================
*/
intptr_t CL_CgameSystemCalls( intptr_t *args )
{
switch ( args[ 0 ] )
{
case CG_PRINT:
Com_Printf( "%s", ( char * ) VMA( 1 ) );
return 0;
case CG_ERROR:
Com_Error( ERR_DROP, "%s", ( char * ) VMA( 1 ) );
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( VMA( 1 ), VMA( 2 ), VMA( 3 ), args[ 4 ] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( VMA( 1 ) );
return 0;
case CG_CVAR_SET:
Cvar_Set( VMA( 1 ), VMA( 2 ) );
return 0;
case CG_CVAR_VARIABLESTRINGBUFFER:
VM_CheckBlock( args[2], args[3], "CVARVSB" );
Cvar_VariableStringBuffer( VMA( 1 ), VMA( 2 ), args[ 3 ] );
return 0;
case CG_CVAR_LATCHEDVARIABLESTRINGBUFFER:
VM_CheckBlock( args[2], args[3], "CVARLVSB" );
Cvar_LatchedVariableStringBuffer( VMA( 1 ), VMA( 2 ), args[ 3 ] );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
VM_CheckBlock( args[2], args[3], "ARGV" );
Cmd_ArgvBuffer( args[ 1 ], VMA( 2 ), args[ 3 ] );
return 0;
case CG_ARGS:
VM_CheckBlock( args[1], args[2], "ARGS" );
Cmd_ArgsBuffer( VMA( 1 ), args[ 2 ] );
return 0;
case CG_LITERAL_ARGS:
// FIXME
VM_CheckBlock( args[1], args[2], "LARGS" );
Cmd_LiteralArgsBuffer( VMA( 1 ), args[ 2 ] );
// Cmd_ArgsBuffer(VMA(1), args[2]);
return 0;
case CG_GETDEMOSTATE:
return CL_DemoState();
case CG_GETDEMOPOS:
return CL_DemoPos();
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA( 1 ), VMA( 2 ), args[ 3 ] );
case CG_FS_READ:
VM_CheckBlock( args[1], args[2], "FSREAD" );
FS_Read2( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case CG_FS_WRITE:
VM_CheckBlock( args[1], args[2], "FSWRITE" );
return FS_Write( VMA( 1 ), args[ 2 ], args[ 3 ] );
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[ 1 ] );
return 0;
case CG_FS_GETFILELIST:
VM_CheckBlock( args[3], args[4], "FSGFL" );
return FS_GetFileList( VMA( 1 ), VMA( 2 ), VMA( 3 ), args[ 4 ] );
case CG_FS_DELETEFILE:
return FS_Delete( VMA( 1 ) );
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( VMA( 1 ) );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( VMA( 1 ) );
return 0;
//.........这里部分代码省略.........
示例9: CL_UISystemCalls
/*
====================
CL_UISystemCalls
The ui module is making a system call
====================
*/
intptr_t CL_UISystemCalls(intptr_t * args) {
switch (args[0]) {
case UI_ERROR:
Com_Error(ERR_DROP, "%s", (char *)VMA(1));
return 0;
case UI_PRINT:
Com_Printf("%s", (char *)VMA(1));
return 0;
case UI_MILLISECONDS:
return Sys_Milliseconds();
case UI_CVAR_REGISTER:
Cvar_Register((vmCvar_t*)VMA(1), (char*)VMA(2), (char*)VMA(3), args[4]);
return 0;
case UI_CVAR_UPDATE:
Cvar_Update((vmCvar_t*)VMA(1));
return 0;
case UI_CVAR_SET:
Cvar_Set((char*)VMA(1), (char*)VMA(2));
return 0;
case UI_CVAR_VARIABLEVALUE:
return FloatAsInt(Cvar_VariableValue((char*)VMA(1)));
case UI_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer((char*)VMA(1), (char*)VMA(2), args[3]);
return 0;
case UI_CVAR_LATCHEDVARIABLESTRINGBUFFER:
Cvar_LatchedVariableStringBuffer((char*)VMA(1), (char*)VMA(2), args[3]);
return 0;
case UI_CVAR_SETVALUE:
Cvar_SetValue((char*)VMA(1), VMF(2));
return 0;
case UI_CVAR_RESET:
Cvar_Reset((char*)VMA(1));
return 0;
case UI_CVAR_CREATE:
Cvar_Get((char*)VMA(1), (char*)VMA(2), args[3], (char*)VMA(4));
return 0;
case UI_CVAR_INFOSTRINGBUFFER:
Cvar_InfoStringBuffer(args[1], (char*)VMA(2), args[3]);
return 0;
case UI_ARGC:
return Cmd_Argc();
case UI_ARGV:
Cmd_ArgvBuffer(args[1], (char*)VMA(2), args[3]);
return 0;
case UI_CMD_EXECUTETEXT:
Cbuf_ExecuteText(args[1], (char*)VMA(2));
return 0;
case UI_ADDCOMMAND:
Cmd_AddCommand((char*)VMA(1), NULL, (char*)VMA(3));
return 0;
case UI_FS_FOPENFILE:
return FS_FOpenFileByMode((char*)VMA(1), (fileHandle_t*)VMA( 2 ), (fsMode_t)args[3] );
case UI_FS_READ:
FS_Read2(VMA(1), args[2], args[3]);
return 0;
case UI_FS_WRITE:
FS_Write(VMA(1), args[2], args[3]);
return 0;
case UI_FS_FCLOSEFILE:
FS_FCloseFile(args[1]);
return 0;
case UI_FS_DELETEFILE:
return FS_Delete((char*)VMA(1));
case UI_FS_GETFILELIST:
return FS_GetFileList((char*)VMA(1), (char*)VMA(2), (char*)VMA(3), args[4]);
case UI_FS_SEEK:
return FS_Seek( args[1], args[2], args[3] );
case UI_R_REGISTERMODEL:
return re.RegisterModel((char*)VMA(1));
case UI_R_REGISTERSKIN:
return re.RegisterSkin((char*)VMA(1));
case UI_R_REGISTERSHADERNOMIP:
return re.RegisterShaderNoMip((char*)VMA(1));
case UI_R_CLEARSCENE:
re.ClearScene();
return 0;
case UI_R_ADDREFENTITYTOSCENE:
re.AddRefEntityToScene((refEntity_t*)VMA(1));
return 0;
case UI_R_ADDPOLYTOSCENE:
re.AddPolyToScene(args[1], args[2], (polyVert_t*)VMA(3));
return 0;
case UI_R_ADDPOLYSTOSCENE:
re.AddPolysToScene(args[1], args[2], (polyVert_t*)VMA(3), args[4]);
return 0;
case UI_R_ADDLIGHTTOSCENE:
re.AddLightToScene((vec_t*)VMA(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), args[7], args[8]);
return 0;
case UI_R_ADDCORONATOSCENE:
re.AddCoronaToScene((vec_t*)VMA(1), VMF(2), VMF(3), VMF(4), VMF(5), args[6], (bool)args[7]);
return 0;
case UI_R_RENDERSCENE:
re.RenderScene((refdef_t*)VMA(1));
//.........这里部分代码省略.........
示例10: CL_UISystemCalls
/*
====================
CL_UISystemCalls
The ui module is making a system call
====================
*/
intptr_t CL_UISystemCalls( intptr_t *args )
{
switch ( args[ 0 ] )
{
case UI_ERROR:
Com_Error( ERR_DROP, "%s", ( char * ) VMA( 1 ) );
case UI_PRINT:
Com_Printf( "%s", ( char * ) VMA( 1 ) );
return 0;
case UI_MILLISECONDS:
return Sys_Milliseconds();
case UI_CVAR_REGISTER:
Cvar_Register( VMA( 1 ), VMA( 2 ), VMA( 3 ), args[ 4 ] );
return 0;
case UI_CVAR_UPDATE:
Cvar_Update( VMA( 1 ) );
return 0;
case UI_CVAR_SET:
Cvar_Set( VMA( 1 ), VMA( 2 ) );
return 0;
case UI_CVAR_VARIABLEVALUE:
return FloatAsInt( Cvar_VariableValue( VMA( 1 ) ) );
case UI_CVAR_VARIABLESTRINGBUFFER:
VM_CheckBlock( args[2], args[3], "CVARVSB" );
Cvar_VariableStringBuffer( VMA( 1 ), VMA( 2 ), args[ 3 ] );
return 0;
case UI_CVAR_LATCHEDVARIABLESTRINGBUFFER:
VM_CheckBlock( args[2], args[3], "CVARLVSB" );
Cvar_LatchedVariableStringBuffer( VMA( 1 ), VMA( 2 ), args[ 3 ] );
return 0;
case UI_CVAR_SETVALUE:
Cvar_SetValue( VMA( 1 ), VMF( 2 ) );
return 0;
case UI_CVAR_RESET:
Cvar_Reset( VMA( 1 ) );
return 0;
case UI_CVAR_CREATE:
Cvar_Get( VMA( 1 ), VMA( 2 ), args[ 3 ] );
return 0;
case UI_CVAR_INFOSTRINGBUFFER:
VM_CheckBlock( args[2], args[3], "CVARISB" );
Cvar_InfoStringBuffer( args[ 1 ], VMA( 2 ), args[ 3 ] );
return 0;
case UI_ARGC:
return Cmd_Argc();
case UI_ARGV:
VM_CheckBlock( args[2], args[3], "ARGV" );
Cmd_ArgvBuffer( args[ 1 ], VMA( 2 ), args[ 3 ] );
return 0;
case UI_CMD_EXECUTETEXT:
Cbuf_ExecuteText( args[ 1 ], VMA( 2 ) );
return 0;
case UI_ADDCOMMAND:
Cmd_AddCommand( VMA( 1 ), NULL );
return 0;
case UI_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA( 1 ), VMA( 2 ), args[ 3 ] );
case UI_FS_READ:
VM_CheckBlock( args[1], args[2], "FSREAD" );
FS_Read2( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case UI_FS_WRITE:
VM_CheckBlock( args[1], args[2], "FSWRITE" );
FS_Write( VMA( 1 ), args[ 2 ], args[ 3 ] );
return 0;
case UI_FS_FCLOSEFILE:
FS_FCloseFile( args[ 1 ] );
return 0;
case UI_FS_DELETEFILE:
return FS_Delete( VMA( 1 ) );
case UI_FS_GETFILELIST:
//.........这里部分代码省略.........
示例11: CL_UISystemCalls
/*
====================
CL_UISystemCalls
The ui module is making a system call
====================
*/
int CL_UISystemCalls( int *args ) {
switch( args[0] ) {
case UI_ERROR:
Com_Error( ERR_DROP, "%s", VMA(1) );
return 0;
case UI_PRINT:
Com_Printf( "%s", VMA(1) );
return 0;
case UI_MILLISECONDS:
return Sys_Milliseconds();
case UI_CVAR_REGISTER:
Cvar_Register( (vmCvar_t *)VMA(1), (const char *)VMA(2), (const char *)VMA(3), args[4] );
return 0;
case UI_CVAR_UPDATE:
Cvar_Update( (vmCvar_t *)VMA(1) );
return 0;
case UI_CVAR_SET:
Cvar_Set( (const char *)VMA(1), (const char *)VMA(2) );
return 0;
case UI_CVAR_VARIABLEVALUE:
return FloatAsInt( Cvar_VariableValue( (const char *)VMA(1) ) );
case UI_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( (const char *)VMA(1), (char *)VMA(2), args[3] );
return 0;
case UI_CVAR_SETVALUE:
Cvar_SetValue( (const char *)VMA(1), VMF(2) );
return 0;
case UI_CVAR_RESET:
Cvar_Reset( (const char *)VMA(1) );
return 0;
case UI_CVAR_CREATE:
Cvar_Get( (const char *)VMA(1), (const char *)VMA(2), args[3] );
return 0;
case UI_CVAR_INFOSTRINGBUFFER:
Cvar_InfoStringBuffer( args[1], (char *)VMA(2), args[3] );
return 0;
case UI_ARGC:
return Cmd_Argc();
case UI_ARGV:
Cmd_ArgvBuffer( args[1], (char *)VMA(2), args[3] );
return 0;
case UI_CMD_EXECUTETEXT:
Cbuf_ExecuteText( args[1], (const char *)VMA(2) );
return 0;
case UI_FS_FOPENFILE:
return FS_FOpenFileByMode( (const char *)VMA(1), (int *)VMA(2), (fsMode_t)args[3] );
case UI_FS_READ:
FS_Read2( VMA(1), args[2], args[3] );
return 0;
case UI_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case UI_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case UI_FS_GETFILELIST:
return FS_GetFileList( (const char *)VMA(1), (const char *)VMA(2), (char *)VMA(3), args[4] );
case UI_R_REGISTERMODEL:
return re.RegisterModel( (const char *)VMA(1) );
case UI_R_REGISTERSKIN:
return re.RegisterSkin( (const char *)VMA(1) );
case UI_R_REGISTERSHADERNOMIP:
return re.RegisterShaderNoMip( (const char *)VMA(1) );
case UI_R_CLEARSCENE:
re.ClearScene();
return 0;
case UI_R_ADDREFENTITYTOSCENE:
re.AddRefEntityToScene( (const refEntity_t *)VMA(1) );
return 0;
//.........这里部分代码省略.........
示例12: CL_CgameSystemCalls
/*
====================
CL_CgameSystemCalls
The cgame module is making a system call
====================
*/
intptr_t CL_CgameSystemCalls( intptr_t *args ) {
switch( args[0] ) {
case CG_PRINT:
Com_Printf( "%s", (const char*)VMA(1) );
return 0;
case CG_ERROR:
Com_Error( ERR_DROP, "%s", (const char*)VMA(1) );
return 0;
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( VMA(1) );
return 0;
case CG_CVAR_SET:
Cvar_Set( VMA(1), VMA(2) );
return 0;
case CG_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( VMA(1), VMA(2), args[3] );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
Cmd_ArgvBuffer( args[1], VMA(2), args[3] );
return 0;
case CG_ARGS:
Cmd_ArgsBuffer( VMA(1), args[2] );
return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case CG_FS_READ:
FS_Read2( VMA(1), args[2], args[3] );
return 0;
case CG_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case CG_FS_SEEK:
return FS_Seek( args[1], args[2], args[3] );
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( VMA(1) );
return 0;
case CG_ADDCOMMAND:
CL_AddCgameCommand( VMA(1) );
return 0;
case CG_REMOVECOMMAND:
Cmd_RemoveCommand( VMA(1) );
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand( VMA(1) );
return 0;
case CG_UPDATESCREEN:
// this is used during lengthy level loading, so pump message loop
// Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN!
// We can't call Com_EventLoop here, a restart will crash and this _does_ happen
// if there is a map change while we are downloading at pk3.
// ZOID
SCR_UpdateScreen();
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( VMA(1) );
return 0;
case CG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case CG_CM_INLINEMODEL:
return CM_InlineModel( args[1] );
case CG_CM_TEMPBOXMODEL:
return CM_TempBoxModel( VMA(1), VMA(2), /*int capsule*/ qfalse );
case CG_CM_TEMPCAPSULEMODEL:
return CM_TempBoxModel( VMA(1), VMA(2), /*int capsule*/ qtrue );
case CG_CM_POINTCONTENTS:
return CM_PointContents( VMA(1), args[2] );
case CG_CM_TRANSFORMEDPOINTCONTENTS:
return CM_TransformedPointContents( VMA(1), args[2], VMA(3), VMA(4) );
case CG_CM_BOXTRACE:
CM_BoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qfalse );
return 0;
case CG_CM_CAPSULETRACE:
CM_BoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], /*int capsule*/ qtrue );
return 0;
case CG_CM_TRANSFORMEDBOXTRACE:
CM_TransformedBoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), /*int capsule*/ qfalse );
return 0;
case CG_CM_TRANSFORMEDCAPSULETRACE:
CM_TransformedBoxTrace( VMA(1), VMA(2), VMA(3), VMA(4), VMA(5), args[6], args[7], VMA(8), VMA(9), /*int capsule*/ qtrue );
return 0;
case CG_CM_MARKFRAGMENTS:
return re.MarkFragments( args[1], VMA(2), VMA(3), args[4], VMA(5), args[6], VMA(7) );
case CG_S_STARTSOUND:
//.........这里部分代码省略.........
示例13: SV_GameSystemCalls
/*
====================
SV_GameSystemCalls
The module is making a system call
====================
*/
intptr_t SV_GameSystemCalls(intptr_t * args) {
switch (args[0]) {
case G_PRINT:
Com_Printf("%s", (char *)VMA(1));
return 0;
case G_ERROR:
Com_Error(ERR_DROP, "%s", (char *)VMA(1));
return 0;
case G_MILLISECONDS:
return Sys_Milliseconds();
case G_CVAR_REGISTER:
Cvar_Register((vmCvar_t*)VMA(1), (char*)VMA(2), (char*)VMA(3), args[4]);
return 0;
case G_CVAR_UPDATE:
Cvar_Update((vmCvar_t*)VMA(1));
return 0;
case G_CVAR_SET:
Cvar_Set((const char *)VMA(1), (const char *)VMA(2));
return 0;
case G_CVAR_VARIABLE_INTEGER_VALUE:
return Cvar_VariableIntegerValue((const char *)VMA(1));
case G_CVAR_VARIABLE_STRING_BUFFER:
Cvar_VariableStringBuffer((char *)VMA(1), (char*)VMA(2), args[3]);
return 0;
case G_CVAR_LATCHEDVARIABLESTRINGBUFFER:
Cvar_LatchedVariableStringBuffer((char *)VMA(1), (char*)VMA(2), args[3]);
return 0;
case G_ARGC:
return Cmd_Argc();
case G_ARGV:
Cmd_ArgvBuffer(args[1], (char*)VMA(2), args[3]);
return 0;
case G_SEND_CONSOLE_COMMAND:
Cbuf_ExecuteText(args[1], (char *)VMA(2));
return 0;
case G_FS_FOPEN_FILE:
return FS_FOpenFileByMode((char *)VMA(1), (fileHandle_t*)VMA(2), (fsMode_t)args[3]);
case G_FS_READ:
FS_Read2(VMA(1), args[2], args[3]);
return 0;
case G_FS_WRITE:
return FS_Write(VMA(1), args[2], args[3]);
case G_FS_RENAME:
FS_Rename((char *)VMA(1), (char *)VMA(2));
return 0;
case G_FS_FCLOSE_FILE:
FS_FCloseFile(args[1]);
return 0;
case G_FS_GETFILELIST:
return FS_GetFileList((char *)VMA(1), (char *)VMA(2), (char*)VMA(3), args[4]);
case G_LOCATE_GAME_DATA:
SV_LocateGameData((sharedEntity_t*)VMA(1), args[2], args[3], (playerState_t*)VMA(4), args[5]);
return 0;
case G_DROP_CLIENT:
SV_GameDropClient(args[1], (char*)VMA(2), args[3]);
return 0;
case G_SEND_SERVER_COMMAND:
SV_GameSendServerCommand(args[1], (char*)VMA(2));
return 0;
case G_LINKENTITY:
SV_LinkEntity((sharedEntity_t*)VMA(1));
return 0;
case G_UNLINKENTITY:
SV_UnlinkEntity((sharedEntity_t*)VMA(1));
return 0;
case G_ENTITIES_IN_BOX:
return SV_AreaEntities((float*)VMA(1), (float*)VMA(2), (int*)VMA(3), args[4]);
case G_ENTITY_CONTACT:
return SV_EntityContact((float*)VMA(1), (float*)VMA(2), (sharedEntity_t*)VMA(3), TT_AABB);
case G_ENTITY_CONTACTCAPSULE:
return SV_EntityContact((float*)VMA(1), (float*)VMA(2), (sharedEntity_t*)VMA(3), TT_CAPSULE);
case G_TRACE:
SV_Trace((trace_t*)VMA(1), (float*)VMA(2), (float*)VMA(3), (float*)VMA(4), (float*)VMA(5), args[6], args[7], TT_AABB);
return 0;
case G_TRACECAPSULE:
SV_Trace((trace_t*)VMA(1), (float*)VMA(2), (float*)VMA(3), (float*)VMA(4), (float*)VMA(5), args[6], args[7], TT_CAPSULE);
return 0;
case G_POINT_CONTENTS:
return SV_PointContents((float*)VMA(1), args[2]);
case G_SET_BRUSH_MODEL:
SV_SetBrushModel((sharedEntity_t*)VMA(1), (char*)VMA(2));
return 0;
case G_IN_PVS:
return SV_inPVS((float*)VMA(1), (float*)VMA(2));
case G_IN_PVS_IGNORE_PORTALS:
return SV_inPVSIgnorePortals((float*)VMA(1), (float*)VMA(2));
case G_SET_CONFIGSTRING:
SV_SetConfigstring(args[1], (char*)VMA(2));
return 0;
case G_GET_CONFIGSTRING:
SV_GetConfigstring(args[1], (char*)VMA(2), args[3]);
return 0;
case G_SET_CONFIGSTRING_RESTRICTIONS:
//.........这里部分代码省略.........
示例14: CL_UISystemCalls
/*
====================
CL_UISystemCalls
The ui module is making a system call
====================
*/
int CL_UISystemCalls( int *args ) {
switch( args[0] ) {
case UI_ERROR:
Com_Error( ERR_DROP, "%s", VMA(1) );
return 0;
case UI_PRINT:
Com_Printf( "%s", VMA(1) );
return 0;
case UI_MILLISECONDS:
return Sys_Milliseconds();
case UI_CVAR_REGISTER:
Cvar_Register( VMA(1), VMA(2), VMA(3), args[4] );
return 0;
case UI_CVAR_UPDATE:
Cvar_Update( VMA(1) );
return 0;
case UI_CVAR_SET:
Cvar_Set( VMA(1), VMA(2) );
return 0;
case UI_CVAR_VARIABLEVALUE:
return FloatAsInt( Cvar_VariableValue( VMA(1) ) );
case UI_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( VMA(1), VMA(2), args[3] );
return 0;
case UI_CVAR_SETVALUE:
Cvar_SetValue( VMA(1), VMF(2) );
return 0;
case UI_CVAR_RESET:
Cvar_Reset( VMA(1) );
return 0;
case UI_CVAR_CREATE:
Cvar_Get( VMA(1), VMA(2), args[3] );
return 0;
case UI_CVAR_INFOSTRINGBUFFER:
Cvar_InfoStringBuffer( args[1], VMA(2), args[3] );
return 0;
case UI_ARGC:
return Cmd_Argc();
case UI_ARGV:
Cmd_ArgvBuffer( args[1], VMA(2), args[3] );
return 0;
case UI_CMD_EXECUTETEXT:
Cbuf_ExecuteText( args[1], VMA(2) );
return 0;
case UI_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case UI_FS_READ:
FS_Read2( VMA(1), args[2], args[3] );
return 0;
case UI_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case UI_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case UI_FS_GETFILELIST:
return FS_GetFileList( VMA(1), VMA(2), VMA(3), args[4] );
case UI_FS_SEEK:
return FS_Seek( args[1], args[2], args[3] );
case UI_R_REGISTERMODEL:
#ifdef IOS_NOTYET
GLimp_AcquireGL();
return re.RegisterModel( VMA(1) );
GLimp_ReleaseGL();
#else
return re.RegisterModel( VMA(1) );
#endif // IOS
case UI_R_REGISTERSKIN:
#ifdef IOS_NOTYET
GLimp_AcquireGL();
return re.RegisterSkin( VMA(1) );
//.........这里部分代码省略.........
示例15: CL_CgameSystemCalls
intptr_t CL_CgameSystemCalls( intptr_t *args )
{
if( cls.cgInterface == 2 && args[0] >= CG_R_SETCLIPREGION && args[0] < CG_MEMSET )
{
if( args[0] < CG_S_STOPBACKGROUNDTRACK - 1 )
args[0] += 1;
else if( args[0] < CG_S_STOPBACKGROUNDTRACK + 4 )
args[0] += CG_PARSE_ADD_GLOBAL_DEFINE - CG_S_STOPBACKGROUNDTRACK + 1;
else if( args[0] < CG_PARSE_ADD_GLOBAL_DEFINE + 4 )
args[0] -= 4;
else if( args[0] >= CG_PARSE_SOURCE_FILE_AND_LINE && args[0] <= CG_S_SOUNDDURATION )
args[0] = CG_PARSE_SOURCE_FILE_AND_LINE - 1337 - args[0] ;
}
switch( args[0] )
{
case CG_PRINT:
Com_Printf( "%s", (const char*)VMA(1) );
return 0;
case CG_ERROR:
if( probingCG )
{
cls.cgInterface = 2; // this is a 1.1.0 cgame
return 0;
}
Com_Error( ERR_DROP, "%s", (const char*)VMA(1) );
return 0;
case CG_MILLISECONDS:
return Sys_Milliseconds();
case CG_CVAR_REGISTER:
Cvar_Register( (vmCvar_t*)VMA(1), (const char*)VMA(2), (const char*)VMA(3), args[4] );
return 0;
case CG_CVAR_UPDATE:
Cvar_Update( (vmCvar_t*)VMA(1) );
return 0;
case CG_CVAR_SET:
Cvar_SetSafe( (const char*)VMA(1), (const char*)VMA(2) );
return 0;
case CG_CVAR_VARIABLESTRINGBUFFER:
Cvar_VariableStringBuffer( (const char*)VMA(1), (char*)VMA(2), args[3] );
return 0;
case CG_ARGC:
return Cmd_Argc();
case CG_ARGV:
Cmd_ArgvBuffer( args[1], (char*)VMA(2), args[3] );
return 0;
case CG_ARGS:
Cmd_ArgsBuffer( (char*)VMA(1), args[2] );
return 0;
case CG_LITERAL_ARGS:
Cmd_LiteralArgsBuffer( (char*)VMA(1), args[2] );
return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( (const char*)VMA(1), (fileHandle_t*)VMA(2), (FS_Mode)args[3] );
case CG_FS_READ:
FS_Read( VMA(1), args[2], args[3] );
return 0;
case CG_FS_WRITE:
FS_Write( VMA(1), args[2], args[3] );
return 0;
case CG_FS_FCLOSEFILE:
FS_FCloseFile( args[1] );
return 0;
case CG_FS_SEEK:
return FS_Seek( (fileHandle_t)args[1], args[2], (FS_Origin)args[3] );
case CG_FS_GETFILELIST:
return FS_GetFileList( (const char*)VMA(1), (const char*)VMA(2), (char*)VMA(3), args[4] );
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( (const char*)VMA(1) );
return 0;
case CG_ADDCOMMAND:
Cmd_AddCommand( (const char*)VMA(1), NULL );
return 0;
case CG_REMOVECOMMAND:
Cmd_RemoveCommandSafe( (const char*)VMA(1) );
return 0;
case CG_SENDCLIENTCOMMAND:
CL_AddReliableCommand((const char*)VMA(1), false);
return 0;
case CG_UPDATESCREEN:
// this is used during lengthy level loading, so pump message loop
// Com_EventLoop(); // FIXME: if a server restarts here, BAD THINGS HAPPEN!
// We can't call Com_EventLoop here, a restart will crash and this _does_ happen
// if there is a map change while we are downloading at pk3.
// ZOID
SCR_UpdateScreen();
return 0;
case CG_CM_LOADMAP:
CL_CM_LoadMap( (const char*)VMA(1) );
return 0;
case CG_CM_NUMINLINEMODELS:
return CM_NumInlineModels();
case CG_CM_INLINEMODEL:
return CM_InlineModel( args[1] );
case CG_CM_TEMPBOXMODEL:
//.........这里部分代码省略.........