您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Cvar_ForceSet函数代码示例

51自学网 2021-06-01 20:16:32
  C++
这篇教程C++ Cvar_ForceSet函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中Cvar_ForceSet函数的典型用法代码示例。如果您正苦于以下问题:C++ Cvar_ForceSet函数的具体用法?C++ Cvar_ForceSet怎么用?C++ Cvar_ForceSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Cvar_ForceSet函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: CL_LocPlace

void CL_LocPlace (void){	trace_t tr;	vec3_t end;	short there[3];	int index1, index2 = -1;	index1 = CL_LocIndex(cl.frame.playerstate.pmove.origin);	VectorMA(cl.predicted_origin, 8192, cl.v_forward, end);	tr = CM_BoxTrace(cl.predicted_origin, end, vec3_origin, vec3_origin, 0, MASK_PLAYERSOLID);	there[0] = tr.endpos[0] * 8;	there[1] = tr.endpos[1] * 8;	there[2] = tr.endpos[2] * 8;	index2 = CL_LocIndex(there);	if (index1 != -1)		Cvar_ForceSet("loc_here", locations[index1].name);	else		Cvar_ForceSet("loc_here", "");	if (index2 != -1)		Cvar_ForceSet("loc_there", locations[index2].name);	else		Cvar_ForceSet("loc_there", "");}
开发者ID:jitspoe,项目名称:starviewer,代码行数:26,


示例2: R_Bloom_InitEffectTexture

/** R_Bloom_InitEffectTexture*/static void R_Bloom_InitEffectTexture( void ){	qbyte *data;	int		limit;	if( r_bloom_sample_size->integer < 32 )		Cvar_ForceSet( "r_bloom_sample_size", "32" );	// make sure bloom size doesn't have stupid values	limit = min( r_bloom_sample_size->integer, min( screen_texture_width, screen_texture_height ) );	if( glConfig.ext.texture_non_power_of_two )		BLOOM_SIZE = limit;	else	// make sure bloom size is a power of 2		for( BLOOM_SIZE = 32; (BLOOM_SIZE<<1) <= limit; BLOOM_SIZE <<= 1 );	if( BLOOM_SIZE != r_bloom_sample_size->integer )		Cvar_ForceSet( "r_bloom_sample_size", va( "%i", BLOOM_SIZE ) );	data = Mem_TempMalloc( BLOOM_SIZE * BLOOM_SIZE * 4 );	memset( data, 0, BLOOM_SIZE * BLOOM_SIZE * 4 );	r_bloomeffecttexture = R_LoadPic( "***r_bloomeffecttexture***", &data, BLOOM_SIZE, BLOOM_SIZE, IT_CLAMP|IT_NOMIPMAP|IT_NOCOMPRESS|IT_NOPICMIP, 3 );	Mem_TempFree( data );}
开发者ID:Kaperstone,项目名称:warsow,代码行数:29,


示例3: CL_StopServerDownload

/** CL_StopServerDownload*/void CL_StopServerDownload( void ){	if( cls.download.filenum > 0 ) {		FS_FCloseFile( cls.download.filenum );		cls.download.filenum = 0;	}	if( cls.download.cancelled ) {		FS_RemoveBaseFile( cls.download.tempname );	}	Mem_ZoneFree( cls.download.name );	cls.download.name = NULL;	Mem_ZoneFree( cls.download.tempname );	cls.download.tempname = NULL;	cls.download.offset = 0;	cls.download.size = 0;	cls.download.percent = 0;	cls.download.timeout = 0;	cls.download.retries = 0;	cls.download.web = qfalse;	Cvar_ForceSet( "cl_download_name", "" );	Cvar_ForceSet( "cl_download_percent", "0" );}
开发者ID:Turupawn,项目名称:DogeWarsow,代码行数:30,


示例4: Con_SetMessageModeCvar

/** Con_SetMessageModeCvar** Called from CL_SetKeyDest*/void Con_SetMessageModeCvar( void ){    if( cls.key_dest == key_message )        Cvar_ForceSet( "con_messageMode", chat_team ? "2" : "1" );    else        Cvar_ForceSet( "con_messageMode", "0" );}
开发者ID:Turupawn,项目名称:DogeWarsow,代码行数:12,


示例5: SV_MOTD_LoadFromFile

/** SV_MOTD_LoadFromFile* * Attempts to load the MOTD from sv_MOTDFile, on success sets* sv_MOTDString.*/void SV_MOTD_LoadFromFile( void ){	char *f;	FS_LoadFile( sv_MOTDFile->string, (void **)&f, NULL, 0 );	if( !f )	{		Com_Printf( "Couldn't load MOTD file: %s/n", sv_MOTDFile->string );		Cvar_ForceSet( "sv_MOTDFile", "" );		SV_MOTD_SetMOTD( "" );		return;	}	if( strchr( f, '"' ) ) // FIXME: others?	{		Com_Printf( "Warning: MOTD file contains illegal characters./n" );		Cvar_ForceSet( "sv_MOTDFile", "" );		SV_MOTD_SetMOTD( "" );	}	else	{		SV_MOTD_SetMOTD( f );	}	FS_FreeFile( f );}
开发者ID:Clever-Boy,项目名称:qfusion,代码行数:32,


示例6: SV_AntiCheat_ParseBuffer

static void SV_AntiCheat_ParseBuffer (void){	byte	 *buff;	int		bufflen;	if (!packetLen)		return;	buff = packetBuffer;	bufflen = packetLen;	Com_DPrintf ("Anticheat packet type %d/n", buff[0]);	switch (buff[0])	{		case ACS_VIOLATION:			SV_AntiCheat_ParseViolation (buff + 1, bufflen - 1);			break;		case ACS_CLIENTACK:			SV_AntiCheat_ParseClientAck (buff + 1, bufflen - 1);			break;		case ACS_FILE_VIOLATION:			SV_AntiCheat_ParseFileViolation (buff + 1, bufflen - 1);			break;		case ACS_READY:			SV_AntiCheat_ParseReady ();			break;		case ACS_QUERYREPLY:			SV_AntiCheat_ParseQueryReply (buff + 1, bufflen - 1);			break;		case ACS_ERROR:			Com_Printf ("ANTICHEAT ERROR: %s/n", LOG_ANTICHEAT|LOG_ERROR|LOG_SERVER, buff + 1);			SV_AntiCheat_Disconnect ();			Cvar_ForceSet ("sv_anticheat_required", "0");			break;		case ACS_NOACCESS:			Com_Printf ("ANTICHEAT WARNING: You do not have permission to use the anticheat server. Anticheat disabled./n", LOG_ANTICHEAT|LOG_WARNING|LOG_SERVER);			SV_AntiCheat_Disconnect ();			Cvar_ForceSet ("sv_anticheat_required", "0");			break;		case ACS_UPDATE_REQUIRED:			Com_Printf ("ANTICHEAT WARNING: The anticheat server is no longer compatible with this version of R1Q2. Please make sure you are using the latest R1Q2 server version. Anticheat disabled./n", LOG_ANTICHEAT|LOG_WARNING|LOG_SERVER);			SV_AntiCheat_Disconnect ();			Cvar_ForceSet ("sv_anticheat_required", "0");			break;		case ACS_DISCONNECT:			SV_AntiCheat_ParseDisconnect (buff + 1, bufflen - 1);			break;		case ACS_PONG:			ping_pending = false;			break;		default:			Com_Printf ("ANTICHEAT ERROR: Unknown command byte %d, please make sure you are using the latest R1Q2 server version. Anticheat disabled./n", LOG_ANTICHEAT|LOG_WARNING|LOG_SERVER, buff[0]);			SV_AntiCheat_Disconnect ();			Cvar_ForceSet ("sv_anticheat_required", "0");			break;	}}
开发者ID:Slipyx,项目名称:r1q2,代码行数:58,


示例7: prepareVideoRefresh

static void prepareVideoRefresh( void ){	// set the right mode for refresh	Cvar_ForceSet( "vid_ref", "gl" );	Cvar_ForceSet( "gl_driver", "opengl32" );	// tell them they're modified so they refresh	vid_ref->modified = true;}
开发者ID:postfix,项目名称:quake2vr,代码行数:9,


示例8: CL_CharacterSkillAndScoreCvars

/** * @todo: replace this cvar hell with confuncs */static void CL_CharacterSkillAndScoreCvars (const character_t* chr){	const chrScoreGlobal_t* score = &chr->score;	Cvar_ForceSet("mn_name", chr->name);	Cvar_ForceSet("mn_body", CHRSH_CharGetBody(chr));	Cvar_ForceSet("mn_head", CHRSH_CharGetHead(chr));	Cvar_ForceSet("mn_body_skin", va("%i", chr->bodySkin));	Cvar_ForceSet("mn_head_skin", va("%i", chr->headSkin));	Cvar_SetValue("mn_vpwr", score->skills[ABILITY_POWER]);	Cvar_SetValue("mn_vspd", score->skills[ABILITY_SPEED]);	Cvar_SetValue("mn_vacc", score->skills[ABILITY_ACCURACY]);	Cvar_SetValue("mn_vmnd", score->skills[ABILITY_MIND]);	Cvar_SetValue("mn_vcls", score->skills[SKILL_CLOSE]);	Cvar_SetValue("mn_vhvy", score->skills[SKILL_HEAVY]);	Cvar_SetValue("mn_vass", score->skills[SKILL_ASSAULT]);	Cvar_SetValue("mn_vsnp", score->skills[SKILL_SNIPER]);	Cvar_SetValue("mn_vexp", score->skills[SKILL_EXPLOSIVE]);	Cvar_SetValue("mn_vpil", score->skills[SKILL_PILOTING]);	Cvar_SetValue("mn_vtar", score->skills[SKILL_TARGETING]);	Cvar_SetValue("mn_vevad", score->skills[SKILL_EVADING]);	Cvar_SetValue("mn_vpwri", score->initialSkills[ABILITY_POWER]);	Cvar_SetValue("mn_vspdi", score->initialSkills[ABILITY_SPEED]);	Cvar_SetValue("mn_vacci", score->initialSkills[ABILITY_ACCURACY]);	Cvar_SetValue("mn_vmndi", score->initialSkills[ABILITY_MIND]);	Cvar_SetValue("mn_vclsi", score->initialSkills[SKILL_CLOSE]);	Cvar_SetValue("mn_vhvyi", score->initialSkills[SKILL_HEAVY]);	Cvar_SetValue("mn_vassi", score->initialSkills[SKILL_ASSAULT]);	Cvar_SetValue("mn_vsnpi", score->initialSkills[SKILL_SNIPER]);	Cvar_SetValue("mn_vexpi", score->initialSkills[SKILL_EXPLOSIVE]);	Cvar_SetValue("mn_vpili", score->initialSkills[SKILL_PILOTING]);	Cvar_SetValue("mn_vtari", score->initialSkills[SKILL_TARGETING]);	Cvar_SetValue("mn_vevadi", score->initialSkills[SKILL_EVADING]);	Cvar_SetValue("mn_vhp", chr->HP);	Cvar_SetValue("mn_vhpmax", chr->maxHP);	Cvar_Set("mn_tpwr", "%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_POWER]), score->skills[ABILITY_POWER]);	Cvar_Set("mn_tspd", "%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_SPEED]), score->skills[ABILITY_SPEED]);	Cvar_Set("mn_tacc", "%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_ACCURACY]), score->skills[ABILITY_ACCURACY]);	Cvar_Set("mn_tmnd", "%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_MIND]), score->skills[ABILITY_MIND]);	Cvar_Set("mn_tcls", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_CLOSE]), score->skills[SKILL_CLOSE]);	Cvar_Set("mn_thvy", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_HEAVY]), score->skills[SKILL_HEAVY]);	Cvar_Set("mn_tass", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_ASSAULT]), score->skills[SKILL_ASSAULT]);	Cvar_Set("mn_tsnp", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_SNIPER]), score->skills[SKILL_SNIPER]);	Cvar_Set("mn_texp", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_EXPLOSIVE]), score->skills[SKILL_EXPLOSIVE]);	Cvar_Set("mn_tpil", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_PILOTING]), score->skills[SKILL_PILOTING]);	Cvar_Set("mn_ttar", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_TARGETING]), score->skills[SKILL_TARGETING]);	Cvar_Set("mn_tevad", "%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_EVADING]), score->skills[SKILL_EVADING]);	Cvar_Set("mn_thp", "%i (%i)", chr->HP, chr->maxHP);}
开发者ID:ArkyRomania,项目名称:ufoai,代码行数:53,


示例9: SV_ReloadPureList

/** SV_ReloadPureList*/static void SV_ReloadPureList( void ) {	char **paks;	int i, numpaks;	Com_FreePureList( &svs.purelist );	// game modules	if( sv_pure_forcemodulepk3->string[0] ) {		if( Q_strnicmp( COM_FileBase( sv_pure_forcemodulepk3->string ), "modules", strlen( "modules" ) ) ||			!FS_IsPakValid( sv_pure_forcemodulepk3->string, NULL ) ) {			Com_Printf( "Warning: Invalid value for sv_pure_forcemodulepk3, disabling/n" );			Cvar_ForceSet( "sv_pure_forcemodulepk3", "" );		} else {			SV_AddPurePak( sv_pure_forcemodulepk3->string );		}	}	if( !sv_pure_forcemodulepk3->string[0] ) {		char *libname;		int libname_size;		libname_size = strlen( LIB_PREFIX ) + 5 + strlen( ARCH ) + strlen( LIB_SUFFIX ) + 1;		libname = Mem_TempMalloc( libname_size );		Q_snprintfz( libname, libname_size, LIB_PREFIX "game_" ARCH LIB_SUFFIX );		if( !FS_PakNameForFile( libname ) ) {			if( sv_pure->integer ) {				Com_Printf( "Warning: Game module not in pk3, disabling pure mode/n" );				Com_Printf( "sv_pure_forcemodulepk3 can be used to force the pure system to use a different module/n" );				Cvar_ForceSet( "sv_pure", "0" );			}		} else {			SV_AddPureFile( libname );		}		Mem_TempFree( libname );		libname = NULL;	}	// *pure.(pk3|pak)	paks = NULL;	numpaks = FS_GetExplicitPurePakList( &paks );	if( numpaks ) {		for( i = 0; i < numpaks; i++ ) {			SV_AddPurePak( paks[i] );			Mem_ZoneFree( paks[i] );		}		Mem_ZoneFree( paks );	}}
开发者ID:adem4ik,项目名称:qfusion,代码行数:53,


示例10: GL_Init

/*===============GL_Init===============*/void GL_Init (void){    gl_vendor = glGetString (GL_VENDOR);    Com_Printf ("GL_VENDOR: %s/n", gl_vendor);    gl_renderer = glGetString (GL_RENDERER);    Com_Printf ("GL_RENDERER: %s/n", gl_renderer);    gl_version = glGetString (GL_VERSION);    Com_Printf ("GL_VERSION: %s/n", gl_version);    gl_extensions = glGetString (GL_EXTENSIONS);//  Com_Printf ("GL_EXTENSIONS: %s/n", gl_extensions); 	Cvar_Register (&gl_strings);	Cvar_ForceSet (&gl_strings, va("GL_VENDOR: %s/nGL_RENDERER: %s/n"		"GL_VERSION: %s/nGL_EXTENSIONS: %s", gl_vendor, gl_renderer, gl_version, gl_extensions));    glClearColor (1,0,0,0);    glCullFace(GL_FRONT);    glEnable(GL_TEXTURE_2D);    glEnable(GL_ALPHA_TEST);    glAlphaFunc(GL_GREATER, 0.666);    glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);    glShadeModel (GL_FLAT);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);    glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);    //	glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);    glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);}
开发者ID:matatk,项目名称:agrip,代码行数:40,


示例11: UI_TabNodeInit

/** called when the window is pushed * check cvar then, reduce runtime check * @todo move cvar check to AbstractOption */static void UI_TabNodeInit (uiNode_t *node, linkedList_t *params){    const char *cvarName;    /* no cvar given? */    if (!(EXTRADATA(node).cvar))        return;    /* not a cvar? */    if (!Q_strstart(EXTRADATA(node).cvar, "*cvar:")) {        /* normalize */        Com_Printf("UI_TabNodeInit: node '%s' doesn't have a valid cvar assigned (/"%s/" read)/n", UI_GetPath(node), EXTRADATA(node).cvar);        EXTRADATA(node).cvar = NULL;        return;    }    /* cvar do not exists? */    cvarName = &EXTRADATA(node).cvar[6];    if (Cvar_FindVar(cvarName) == NULL) {        /* search default value, if possible */        uiNode_t* option = node->firstChild;        assert(option->behaviour == ui_optionBehaviour);        Cvar_ForceSet(cvarName, OPTIONEXTRADATA(option).value);    }}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:29,


示例12: UI_TextEntryNodeEdit

/** * @brief edit the current cvar with a char */static void UI_TextEntryNodeEdit (uiNode_t* node, unsigned int unicode){	char buffer[MAX_CVAR_EDITING_LENGTH];	/* copy the cvar */	Q_strncpyz(buffer, editedCvar->string, sizeof(buffer));	/* compute result */	if (unicode == K_BACKSPACE) {		if (EXTRADATA(node).cursorPosition > 0){			UTF8_delete_char_at(buffer, EXTRADATA(node).cursorPosition - 1);			EXTRADATA(node).cursorPosition--;		}	} else if (unicode == K_DEL) {		if (EXTRADATA(node).cursorPosition < UTF8_strlen(editedCvar->string)){			UTF8_delete_char_at(buffer, EXTRADATA(node).cursorPosition);		}	} else {		int length = strlen(buffer);		int charLength = UTF8_encoded_len(unicode);		/* is buffer full? */		if (length + charLength >= sizeof(buffer))			return;		int insertedLength = UTF8_insert_char_at(buffer, sizeof(buffer), EXTRADATA(node).cursorPosition, unicode);		if (insertedLength > 0)			EXTRADATA(node).cursorPosition++;	}	/* update the cvar */	Cvar_ForceSet(editedCvar->name, buffer);}
开发者ID:ArkyRomania,项目名称:ufoai,代码行数:36,


示例13: Cl_Record_f

/* * Cl_Record_f * * record <demo name> * * Begin recording a demo from the current frame until `stop` is issued. */void Cl_Record_f(void) {	if (Cmd_Argc() != 2) {		Com_Print("Usage: %s <demo name>/n", Cmd_Argv(0));		return;	}	if (cls.demo_file) {		Com_Print("Already recording./n");		return;	}	if (cls.state != CL_ACTIVE) {		Com_Print("You must be in a level to record./n");		return;	}	// open the demo file	snprintf(cls.demo_path, sizeof(cls.demo_path), "%s/demos/%s.dem", Fs_Gamedir(), Cmd_Argv(1));	Fs_CreatePath(cls.demo_path);	cls.demo_file = fopen(cls.demo_path, "wb");	if (!cls.demo_file) {		Com_Warn("Cl_Record_f: couldn't open %s./n", cls.demo_path);		return;	}	// don't start saving messages until a non-delta compressed message is received	cls.demo_waiting = true;	// update user info var to inform server to send angles	Cvar_ForceSet("recording", "1");	Com_Print("Requesting demo support from server.../n");}
开发者ID:darkshade9,项目名称:aq2w,代码行数:42,


示例14: assert

/** * @brief Called when the node got the focus */void uiTextEntryNode::onFocusGained (uiNode_t* node){	assert(editedCvar == nullptr);	/* skip '*cvar ' */	const char* cvarRef = "*cvar:";	editedCvar = Cvar_Get(&((const char*)node->text)[strlen(cvarRef)]);	assert(editedCvar);	Q_strncpyz(cvarValueBackup, editedCvar->string, sizeof(cvarValueBackup));	isAborted = false;	EXTRADATA(node).cursorPosition = UTF8_strlen(editedCvar->string);#if SDL_VERSION_ATLEAST(2,0,0)	SDL_StartTextInput();	vec2_t pos;	UI_GetNodeAbsPos(node, pos);	SDL_Rect r = {static_cast<int>(pos[0]), static_cast<int>(pos[1]), static_cast<int>(node->box.size[0]), static_cast<int>(node->box.size[1])};	SDL_SetTextInputRect(&r);#else#ifdef ANDROID	char buf[MAX_CVAR_EDITING_LENGTH];	Q_strncpyz(buf, editedCvar->string, sizeof(buf));	SDL_ANDROID_GetScreenKeyboardTextInput(buf, sizeof(buf));	Cvar_ForceSet(editedCvar->name, buf);	UI_TextEntryNodeValidateEdition(node);	UI_RemoveFocus();#endif#endif}
开发者ID:ArkyRomania,项目名称:ufoai,代码行数:31,


示例15: CL_MM_Login

/** CL_MM_Login*/qboolean CL_MM_Login( const char *user, const char *password ){	// first figure out the user	if( !user || user[0] == '/0' )		user = cl_mm_user->string;	else	{		if( cl_mm_autologin->integer )			Cvar_ForceSet( "cl_mm_user", user );	}	// TODO: nicer error announcing	if( !password || password[0] == '/0' )		password = MM_PasswordRead( user );	else	{		if( cl_mm_autologin->integer )			MM_PasswordWrite( user, password );	}	if( password == NULL )	{		CL_MM_ErrorMessage( qtrue, "MM Login: Password error");		return qfalse;	}	return CL_MM_LoginReal( user, password );}
开发者ID:Kaperstone,项目名称:warsow,代码行数:31,


示例16: SCR_RegisterConsoleFont

/** SCR_RegisterConsoleFont*/static void SCR_RegisterConsoleFont( void ){	const char *con_fontSystemFamilyName;	const int con_fontSystemStyle = DEFAULT_SYSTEM_FONT_STYLE;	int size;	float pixelRatio = Con_GetPixelRatio();	// register system fonts	con_fontSystemFamilyName = con_fontSystemFamily->string;	if( !con_fontSystemConsoleSize->integer ) {		Cvar_SetValue( con_fontSystemConsoleSize->name, DEFAULT_SYSTEM_FONT_SMALL_SIZE );	} else if( con_fontSystemConsoleSize->integer > DEFAULT_SYSTEM_FONT_SMALL_SIZE * 2 ) {		Cvar_SetValue( con_fontSystemConsoleSize->name, DEFAULT_SYSTEM_FONT_SMALL_SIZE * 2 );	} else if( con_fontSystemConsoleSize->integer < DEFAULT_SYSTEM_FONT_SMALL_SIZE / 2 ) {		Cvar_SetValue( con_fontSystemConsoleSize->name, DEFAULT_SYSTEM_FONT_SMALL_SIZE / 2 );	}	size = ceil( con_fontSystemConsoleSize->integer * pixelRatio );	cls.consoleFont = SCR_RegisterFont( con_fontSystemFamilyName, con_fontSystemStyle, size );	if( !cls.consoleFont )	{		Cvar_ForceSet( con_fontSystemFamily->name, con_fontSystemFamily->dvalue );		con_fontSystemFamilyName = con_fontSystemFamily->dvalue;		size = DEFAULT_SYSTEM_FONT_SMALL_SIZE;		cls.consoleFont = SCR_RegisterFont( con_fontSystemFamilyName, con_fontSystemStyle, size );		if( !cls.consoleFont )			Com_Error( ERR_FATAL, "Couldn't load default font /"%s/"", con_fontSystemFamily->dvalue );		Con_CheckResize();	}}
开发者ID:tenght,项目名称:qfusion,代码行数:35,


示例17: SCR_ResetSystemFontConsoleSize

/** SCR_ResetSystemFontConsoleSize*/void SCR_ResetSystemFontConsoleSize( void ){	if( !con_fontSystemConsoleSize ) {		return;	}	Cvar_ForceSet( con_fontSystemConsoleSize->name, con_fontSystemConsoleSize->dvalue );	SCR_CheckSystemFontsModified();}
开发者ID:tenght,项目名称:qfusion,代码行数:11,


示例18: UI_ExecuteSetAction

static inline void UI_ExecuteSetAction (const uiAction_t* action, const uiCallContext_t *context){	const char* path;	uiNode_t *node;	const value_t *property;	const uiAction_t *left;	uiAction_t *right;	left = action->d.nonTerminal.left;	if (left == NULL) {		Com_Printf("UI_ExecuteSetAction: Action without left operand skipped./n");		return;	}	right = action->d.nonTerminal.right;	if (right == NULL) {		Com_Printf("UI_ExecuteSetAction: Action without right operand skipped./n");		return;	}	if (left->type == EA_VALUE_CVARNAME || left->type == EA_VALUE_CVARNAME_WITHINJECTION) {		const char *cvarName;		const char* textValue;		if (left->type == EA_VALUE_CVARNAME)			cvarName = left->d.terminal.d1.constString;		else			cvarName = UI_GenInjectedString(left->d.terminal.d1.constString, false, context);		textValue = UI_GetStringFromExpression(right, context);		if (textValue[0] == '_')			textValue = _(textValue + 1);		Cvar_ForceSet(cvarName, textValue);		return;	}	/* search the node */	if (left->type == EA_VALUE_PATHPROPERTY)		path = left->d.terminal.d1.constString;	else if (left->type == EA_VALUE_PATHPROPERTY_WITHINJECTION)		path = UI_GenInjectedString(left->d.terminal.d1.constString, false, context);	else		Com_Error(ERR_FATAL, "UI_ExecuteSetAction: Property setter with wrong type '%d'", left->type);	UI_ReadNodePath(path, context->source, &node, &property);	if (!node) {		Com_Printf("UI_ExecuteSetAction: node /"%s/" doesn't exist (source: %s)/n", path, UI_GetPath(context->source));		return;	}	if (!property) {		Com_Printf("UI_ExecuteSetAction: property /"%s/" doesn't exist (source: %s)/n", path, UI_GetPath(context->source));		return;	}	UI_NodeSetPropertyFromActionValue(node, property, context, right);}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:58,


示例19: SV_AutoUpdateFromWeb

/** SV_AutoUpdateFromWeb*/void SV_AutoUpdateFromWeb( bool checkOnly ){	if( checkOnly ) {		Com_Autoupdate_Run( true, NULL );		return;	}	Cvar_ForceSet( "sv_lastAutoUpdate", va( "%i", (int)Com_DaysSince1900() ) );	Com_Autoupdate_Run( false, &SV_AutoUpdateComplete_f );}
开发者ID:MGXRace,项目名称:racesow,代码行数:13,


示例20: R_Bloom_InitTextures

/** R_Bloom_InitTextures*/static void R_Bloom_InitTextures( void ){	qbyte *data;	int size;	if( glConfig.ext.texture_non_power_of_two )	{		screen_texture_width = glState.width;		screen_texture_height = glState.height;	}	else	{		// find closer power of 2 to screen size 		for (screen_texture_width = 1;screen_texture_width < glState.width;screen_texture_width <<= 1);		for (screen_texture_height = 1;screen_texture_height < glState.height;screen_texture_height <<= 1);	}	// disable blooms if we can't handle a texture of that size	if( screen_texture_width > glConfig.maxTextureSize || screen_texture_height > glConfig.maxTextureSize )	{		screen_texture_width = screen_texture_height = 0;		Cvar_ForceSet( "r_bloom", "0" );		Com_Printf( S_COLOR_YELLOW "WARNING: 'R_InitBloomScreenTexture' too high resolution for light bloom, effect disabled/n" );		return;	}	// init the screen texture	size = screen_texture_width * screen_texture_height * 4;	data = Mem_TempMalloc( size );	memset( data, 255, size );	r_bloomscreentexture = R_LoadPic( "***r_bloomscreentexture***", &data, screen_texture_width, screen_texture_height, IT_CLAMP|IT_NOMIPMAP|IT_NOCOMPRESS|IT_NOPICMIP, 3 );	Mem_TempFree( data );	// validate bloom size and init the bloom effect texture	R_Bloom_InitEffectTexture();	// if screensize is more than 2x the bloom effect texture, set up for stepped downsampling	r_bloomdownsamplingtexture = NULL;	r_screendownsamplingtexture_size = 0;	if( (glState.width > (BLOOM_SIZE * 2) || glState.height > (BLOOM_SIZE * 2)) && !r_bloom_fast_sample->integer )	{		r_screendownsamplingtexture_size = (int)( BLOOM_SIZE * 2 );		data = Mem_TempMalloc( r_screendownsamplingtexture_size * r_screendownsamplingtexture_size * 4 );		memset( data, 0, r_screendownsamplingtexture_size * r_screendownsamplingtexture_size * 4 );		r_bloomdownsamplingtexture = R_LoadPic( "***r_bloomdownsamplingtexture***", &data, r_screendownsamplingtexture_size, r_screendownsamplingtexture_size, IT_CLAMP|IT_NOMIPMAP|IT_NOCOMPRESS|IT_NOPICMIP, 3 );		Mem_TempFree( data );	}	// init the screen backup texture	if( r_screendownsamplingtexture_size )		R_Bloom_InitBackUpTexture( r_screendownsamplingtexture_size, r_screendownsamplingtexture_size );	else		R_Bloom_InitBackUpTexture( BLOOM_SIZE, BLOOM_SIZE );}
开发者ID:Kaperstone,项目名称:warsow,代码行数:58,


示例21: FS_Tick

void FS_Tick(){	// process "fs_logFile" changes	if (fs_logFile->modified)	{		fs_logFile->modified = false;		if (FSLog != GNull && FSLog != GLog)			delete FSLog;		switch (fs_logFile->integer)		{		case 0:			FSLog = GNull;			break;		case 1:			FSLog = GLog;		//?? colorized log			break;		default:				// case 2			FSLog = new COutputDeviceFile(FS_LOG);			FSLog->Printf("/n*** File system activity, %s ***/n/n", appTimestamp());			break;		}	}	// process "game" changes	if (fs_game->modified)	{		//!! WARNING: configuration will be saved even if game is not changed (bad game or "baseq2"->"")		if (!stricmp(fs_game->string, BASEDIRNAME))			Cvar_ForceSet("game", "");	// BASEDIRNAME->""		CL_WriteConfiguration(fs_configfile->string);		if (FS.SetGameDir(fs_game->string))		{			LoadGameConfig();			if (!DEDICATED)				Cbuf_AddText("vid_restart/nsnd_restart/n");		}		Cvar_ForceSet("game", (FS.GameDir == BASEDIRNAME) ? "" : *FS.GameDir);		fs_game->modified = false;	}}
开发者ID:RkShaRkz,项目名称:Quake2,代码行数:42,


示例22: CL_CharacterSkillAndScoreCvars

static void CL_CharacterSkillAndScoreCvars (const character_t *chr, const char* cvarPrefix){	const chrScoreGlobal_t *score = &chr->score;	Cvar_ForceSet(va("%s%s", cvarPrefix, "name"), chr->name);	Cvar_ForceSet(va("%s%s", cvarPrefix, "body"), CHRSH_CharGetBody(chr));	Cvar_ForceSet(va("%s%s", cvarPrefix, "head"), CHRSH_CharGetHead(chr));	Cvar_ForceSet(va("%s%s", cvarPrefix, "skin"), va("%i", chr->bodySkin));	Cvar_ForceSet(va("%s%s", cvarPrefix, "skinname"), CL_GetTeamSkinName(chr->bodySkin));	Cvar_Set(va("%s%s", cvarPrefix, "vpwr"), va("%i", score->skills[ABILITY_POWER]));	Cvar_Set(va("%s%s", cvarPrefix, "vspd"), va("%i", score->skills[ABILITY_SPEED]));	Cvar_Set(va("%s%s", cvarPrefix, "vacc"), va("%i", score->skills[ABILITY_ACCURACY]));	Cvar_Set(va("%s%s", cvarPrefix, "vmnd"), va("%i", score->skills[ABILITY_MIND]));	Cvar_Set(va("%s%s", cvarPrefix, "vcls"), va("%i", score->skills[SKILL_CLOSE]));	Cvar_Set(va("%s%s", cvarPrefix, "vhvy"), va("%i", score->skills[SKILL_HEAVY]));	Cvar_Set(va("%s%s", cvarPrefix, "vass"), va("%i", score->skills[SKILL_ASSAULT]));	Cvar_Set(va("%s%s", cvarPrefix, "vsnp"), va("%i", score->skills[SKILL_SNIPER]));	Cvar_Set(va("%s%s", cvarPrefix, "vexp"), va("%i", score->skills[SKILL_EXPLOSIVE]));	Cvar_Set(va("%s%s", cvarPrefix, "vpwri"), va("%i", score->initialSkills[ABILITY_POWER]));	Cvar_Set(va("%s%s", cvarPrefix, "vspdi"), va("%i", score->initialSkills[ABILITY_SPEED]));	Cvar_Set(va("%s%s", cvarPrefix, "vacci"), va("%i", score->initialSkills[ABILITY_ACCURACY]));	Cvar_Set(va("%s%s", cvarPrefix, "vmndi"), va("%i", score->initialSkills[ABILITY_MIND]));	Cvar_Set(va("%s%s", cvarPrefix, "vclsi"), va("%i", score->initialSkills[SKILL_CLOSE]));	Cvar_Set(va("%s%s", cvarPrefix, "vhvyi"), va("%i", score->initialSkills[SKILL_HEAVY]));	Cvar_Set(va("%s%s", cvarPrefix, "vassi"), va("%i", score->initialSkills[SKILL_ASSAULT]));	Cvar_Set(va("%s%s", cvarPrefix, "vsnpi"), va("%i", score->initialSkills[SKILL_SNIPER]));	Cvar_Set(va("%s%s", cvarPrefix, "vexpi"), va("%i", score->initialSkills[SKILL_EXPLOSIVE]));	Cvar_Set(va("%s%s", cvarPrefix, "vhp"), va("%i", chr->HP));	Cvar_Set(va("%s%s", cvarPrefix, "vhpmax"), va("%i", chr->maxHP));	Cvar_Set(va("%s%s", cvarPrefix, "tpwr"), va("%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_POWER]), score->skills[ABILITY_POWER]));	Cvar_Set(va("%s%s", cvarPrefix, "tspd"), va("%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_SPEED]), score->skills[ABILITY_SPEED]));	Cvar_Set(va("%s%s", cvarPrefix, "tacc"), va("%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_ACCURACY]), score->skills[ABILITY_ACCURACY]));	Cvar_Set(va("%s%s", cvarPrefix, "tmnd"), va("%s (%i)", CL_ActorGetSkillString(score->skills[ABILITY_MIND]), score->skills[ABILITY_MIND]));	Cvar_Set(va("%s%s", cvarPrefix, "tcls"), va("%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_CLOSE]), score->skills[SKILL_CLOSE]));	Cvar_Set(va("%s%s", cvarPrefix, "thvy"), va("%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_HEAVY]), score->skills[SKILL_HEAVY]));	Cvar_Set(va("%s%s", cvarPrefix, "tass"), va("%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_ASSAULT]), score->skills[SKILL_ASSAULT]));	Cvar_Set(va("%s%s", cvarPrefix, "tsnp"), va("%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_SNIPER]), score->skills[SKILL_SNIPER]));	Cvar_Set(va("%s%s", cvarPrefix, "texp"), va("%s (%i)", CL_ActorGetSkillString(score->skills[SKILL_EXPLOSIVE]), score->skills[SKILL_EXPLOSIVE]));	Cvar_Set(va("%s%s", cvarPrefix, "thp"), va("%i (%i)", chr->HP, chr->maxHP));}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:41,


示例23: sv_mm_login_done

/** sv_mm_login_done* callback for login post request*/static void sv_mm_login_done( stat_query_t *query, qboolean success, void *customp ){	stat_query_section_t *root;	sv_mm_initialized = qfalse;	sv_login_query = NULL;	if( !success )	{		Com_Printf( "SV_MM_Login_Done: Error/n" );		Cvar_ForceSet( sv_mm_enable->name, "0" );		return;	}	Com_DPrintf( "SV_MM_Login: %s/n", sq_api->GetRawResponse( query ) );	/*	 * ch : JSON API	 * {	 *		id: [int], // 0 on error, > 0 on success	 * }	 */	root = sq_api->GetRoot( query );	if( root == NULL )	{		Com_Printf("SV_MM_Login: Failed to parse data/n");	}	else	{		sv_mm_session = (int)sq_api->GetNumber( root, "id" );		sv_mm_initialized = ( sv_mm_session == 0 ? qfalse : qtrue );	}	if( sv_mm_initialized )		Com_Printf( "SV_MM_Login: Success, session id %u/n", sv_mm_session );	else	{		Com_Printf( "SV_MM_Login: Failed, no session id/n" );		Cvar_ForceSet( sv_mm_enable->name, "0" );	}}
开发者ID:Kaperstone,项目名称:warsow,代码行数:45,


示例24: SV_Shutdown

/*================SV_ShutdownCalled when each game quits, and before exitting application================*/void SV_Shutdown(const char *finalmsg, bool reconnect){	guard(SV_Shutdown);	if (svs.clients)	// NOTE: this required even for attractloop: if disable, when demo finishes, client will not be automatically disconnected	{		int			i;		client_t	*cl;		// Send a final message to all connected clients before the server goes down.		//  The messages are sent immediately, not just stuck on the outgoing message		// list, because the server is going to totally exit after returning from this function.		for (i = 0, cl = svs.clients; i < sv_maxclients->integer; i++, cl++)		{			if (cl->state < cs_connected)				continue;			net_message.Clear();			MSG_WriteByte(&net_message, svc_print);			MSG_WriteByte(&net_message, PRINT_HIGH);			if (cl->newprotocol && !reconnect)	// colorize exit message				MSG_WriteString(&net_message, va(S_RED"%s", finalmsg));			else				MSG_WriteString(&net_message, finalmsg);			MSG_WriteByte(&net_message, reconnect ? svc_reconnect : svc_disconnect);			cl->netchan.Transmit(net_message.data, net_message.cursize);		}	}	Master_Shutdown();	SV_ShutdownGameLibrary();	// free current level	if (sv.rdemofile)		delete sv.rdemofile;	memset(&sv, 0, sizeof(sv));	Com_SetServerState(ss_dead);	// == 0	// free server static data	sv_client = NULL;	if (svs.clients) delete svs.clients;	if (svs.client_entities) delete svs.client_entities;	if (svs.wdemofile)		fclose(svs.wdemofile);	memset(&svs, 0, sizeof(svs));	SV_InitVars();	// called for unlocking latched vars	Cvar_ForceSet("nointro", "1");	unguard;}
开发者ID:RkShaRkz,项目名称:Quake2,代码行数:60,


示例25: SV_ReadServerFile

voidSV_ReadServerFile(void){	fileHandle_t f;	char name[MAX_OSPATH], string[128];	char comment[32];	char mapcmd[MAX_TOKEN_CHARS];	Com_DPrintf("SV_ReadServerFile()/n");	Com_sprintf(name, sizeof(name), "save/current/server.ssv");	FS_FOpenFile(name, &f, FS_READ);	if (!f)	{		Com_Printf("Couldn't read %s/n", name);		return;	}	/* read the comment field */	FS_Read(comment, sizeof(comment), f);	/* read the mapcmd */	FS_Read(mapcmd, sizeof(mapcmd), f);	/* read all CVAR_LATCH cvars	   these will be things like 	   coop, skill, deathmatch, etc */	while (1)	{		char cvarname[LATCH_CVAR_SAVELENGTH] = {0};		if (!FS_FRead(cvarname, 1, sizeof(cvarname), f))		{			break;		}		FS_Read(string, sizeof(string), f);		Com_DPrintf("Set %s = %s/n", cvarname, string);		Cvar_ForceSet(cvarname, string);	}	FS_FCloseFile(f);	/* start a new game fresh with new cvars */	SV_InitGame();	strcpy(svs.mapcmd, mapcmd);	/* read game state */	Com_sprintf(name, sizeof(name), "%s/save/current/game.ssv", FS_Gamedir());	ge->ReadGame(name);}
开发者ID:bradc6,项目名称:yquake2,代码行数:52,



注:本文中的Cvar_ForceSet函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ Cvar_FullSet函数代码示例
C++ Cvar_FindVar函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。