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

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

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

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

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

示例1: CL_SendConnectPacket

/*=======================CL_SendConnectPacketWe have gotten a challenge from the server, so try andconnect.======================*/void CL_SendConnectPacket (void){	netadr_t	adr;	int		port;	if (!NET_StringToAdr (cls.servername, &adr))	{		Com_Printf ("Bad server address/n");		cls.connect_time = 0;		return;	}	if (adr.port == 0)		adr.port = BigShort (PORT_SERVER);	port = Cvar_VariableValue ("qport");	userinfo_modified = false;	Netchan_OutOfBandPrint (NS_CLIENT, adr, "connect %i %i %i /"%s/"/n",		PROTOCOL_VERSION, port, cls.challenge, Cvar_Userinfo() );}
开发者ID:qbism,项目名称:Quake2-colored-refsoft,代码行数:28,


示例2: IN_Frame

void IN_Frame (void) {  // bk001130 - from cvs 1.17 (mkv)  IN_JoyMove(); // FIXME: disable if on desktop?  if ( cls.keyCatchers & KEYCATCH_CONSOLE )  {    // temporarily deactivate if not in the game and    // running on the desktop    // voodoo always counts as full screen    if (Cvar_VariableValue ("r_fullscreen") == 0        && strcmp( Cvar_VariableString("r_glDriver"), _3DFX_DRIVER_NAME ) )    {      IN_DeactivateMouse ();      return;    }  }  IN_ActivateMouse();}
开发者ID:AlienHoboken,项目名称:Tremulous-W-Server,代码行数:20,


示例3: Cvar_Toggle_f

/*============Cvar_Toggle_fToggles a cvar for easy single key binding, optionally through a list ofgiven values============*/void Cvar_Toggle_f(void){	int  i, c = Cmd_Argc();	char *curval;	if (c < 2)	{		Com_Printf("usage: toggle <variable> [value1, value2, ...]/n");		return;	}	if (c == 2)	{		Cvar_Set2(Cmd_Argv(1), va("%d",		                          !Cvar_VariableValue(Cmd_Argv(1))),		          qfalse);		return;	}	if (c == 3)	{		Com_Printf("toggle: nothing to toggle to/n");		return;	}	curval = Cvar_VariableString(Cmd_Argv(1));	// don't bother checking the last arg for a match since the desired	// behaviour is the same as no match (set to the first argument)	for (i = 2; i + 1 < c; i++)	{		if (strcmp(curval, Cmd_Argv(i)) == 0)		{			Cvar_Set2(Cmd_Argv(1), Cmd_Argv(i + 1), qfalse);			return;		}	}	// fallback	Cvar_Set2(Cmd_Argv(1), Cmd_Argv(2), qfalse);}
开发者ID:Ponce,项目名称:etlegacy,代码行数:49,


示例4: SV_CheckForSavegame

/*=================SV_CheckForSavegame=================*/void SV_CheckForSavegame (void){	char		name[MAX_OSPATH];	FILE		*f;	int			i;	if (sv_noreload->value)		return;	if (Cvar_VariableValue ("deathmatch"))		return;	Com_sprintf (name, sizeof(name), "%s/save/current/%s.sav", FS_Gamedir(), sv.name);	f = fopen (name, "rb");	if (!f)		return;		// no savegame	fclose (f);	SV_ClearWorld ();	// get configstrings and areaportals	SV_ReadLevelFile ();	if (!sv.loadgame)	{	// coming back to a level after being in a different		// level, so run it for ten seconds		// rlava2 was sending too many lightstyles, and overflowing the		// reliable data. temporarily changing the server state to loading		// prevents these from being passed down.		server_state_t		previousState;		// PGM		previousState = sv.state;				// PGM		sv.state = ss_loading;					// PGM		for (i=0 ; i<100 ; i++)			ge->RunFrame ();		sv.state = previousState;				// PGM	}}
开发者ID:1vanK,项目名称:Urho3DQuake2,代码行数:46,


示例5: SVC_Status

/*================SVC_StatusResponds with all the info that qplug or qspy can see about the serverand all connected players.  Used for getting detailed information afterthe simple info query.================*/void SVC_Status( netadr_t from ) {	char	player[1024];	char	status[MAX_MSGLEN];	int		i;	client_t	*cl;	playerState_t	*ps;	int		statusLength;	int		playerLength;	char	infostring[MAX_INFO_STRING];	// ignore if we are in single player	if ( Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER ) {		return;	}	strcpy( infostring, Cvar_InfoString( CVAR_SERVERINFO ) );	// echo back the parameter to status. so master servers can use it as a challenge	// to prevent timed spoofed reply packets that add ghost servers	Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) );	status[0] = 0;	statusLength = 0;	for (i=0 ; i < sv_maxclients->integer ; i++) {		cl = &svs.clients[i];		if ( cl->state >= CS_CONNECTED ) {			ps = SV_GameClientNum( i );			Com_sprintf (player, sizeof(player), "%i %i /"%s/"/n",				ps->persistant[PERS_SCORE], cl->ping, cl->name);			playerLength = strlen(player);			if (statusLength + playerLength >= sizeof(status) ) {				break;		// can't hold any more			}			strcpy (status + statusLength, player);			statusLength += playerLength;		}	}	NET_OutOfBandPrint( NS_SERVER, from, "statusResponse/n%s/n%s", infostring, status );}
开发者ID:Barbatos,项目名称:ioq3-for-UrbanTerror-4,代码行数:50,


示例6: Host_Exec_f

/*===============Host_Exec_f===============*/void Host_Exec_f( void ){	string	cfgpath;	char	*f, *txt; 	size_t	len;	if( Cmd_Argc() != 2 )	{		Msg( "Usage: exec <filename>/n" );		return;	}	// HACKHACK: don't execute listenserver.cfg in singleplayer	if( !Q_stricmp( Cvar_VariableString( "lservercfgfile" ),  Cmd_Argv( 1 )))	{		if( Cvar_VariableValue( "maxplayers" ) == 1.0f )			return;	}	Q_strncpy( cfgpath, Cmd_Argv( 1 ), sizeof( cfgpath )); 	FS_DefaultExtension( cfgpath, ".cfg" ); // append as default	f = FS_LoadFile( cfgpath, &len, false );	if( !f )	{		MsgDev( D_NOTE, "couldn't exec %s/n", Cmd_Argv( 1 ));		return;	}	// adds /n/0 at end of the file	txt = Z_Malloc( len + 2 );	Q_memcpy( txt, f, len );	Q_strncat( txt, "/n", len + 2 );	Mem_Free( f );	MsgDev( D_INFO, "execing %s/n", Cmd_Argv( 1 ));	Cbuf_InsertText( txt );	Mem_Free( txt );}
开发者ID:emileb,项目名称:xash3d,代码行数:44,


示例7: NET_OpenIPX

/*====================NET_OpenIPX====================*/void NET_OpenIPX (void){	int		port;	int		dedicated;	dedicated = Cvar_VariableValue ("dedicated");	if (!ipx_sockets[NS_SERVER])	{		port = Cvar_Get("ipx_hostport", "0", CVAR_NOSET)->value;		if (!port)		{			port = Cvar_Get("hostport", "0", CVAR_NOSET)->value;			if (!port)			{				port = Cvar_Get("port", va("%i", PORT_SERVER), CVAR_NOSET)->value;			}		}		ipx_sockets[NS_SERVER] = NET_IPXSocket (port);	}	// dedicated servers don't need client ports	if (dedicated)		return;	if (!ipx_sockets[NS_CLIENT])	{		port = Cvar_Get("ipx_clientport", "0", CVAR_NOSET)->value;		if (!port)		{			port = Cvar_Get("clientport", va("%i", PORT_CLIENT), CVAR_NOSET)->value;			if (!port)				port = PORT_ANY;		}		ipx_sockets[NS_CLIENT] = NET_IPXSocket (port);		if (!ipx_sockets[NS_CLIENT])			ipx_sockets[NS_CLIENT] = NET_IPXSocket (PORT_ANY);	}}
开发者ID:petmac,项目名称:quake2-lite,代码行数:44,


示例8: CL_InitUI

void CL_InitUI( void ) {	int		v;	vmInterpret_t		interpret;	// load the dll or bytecode	interpret = Cvar_VariableValue("vm_ui");	if(cl_connectedToPureServer)	{		// if sv_pure is set we only allow qvms to be loaded		if(interpret != VMI_COMPILED && interpret != VMI_BYTECODE)			interpret = VMI_COMPILED;	}	uivm = VM_Create( "ui", CL_UISystemCalls, interpret );	if ( !uivm ) {		Com_Error( ERR_FATAL, "VM_Create on UI failed" );	}	// sanity check	v = VM_Call( uivm, UI_GETAPIVERSION );	if (v == UI_OLD_API_VERSION) {//		Com_Printf(S_COLOR_YELLOW "WARNING: loading old Quake III Arena User Interface version %d/n", v );		// init for this gamestate		VM_Call( uivm, UI_INIT, (clc.state >= CA_CONNECTING_NAT && clc.state < CA_ACTIVE));	}	else if (v != UI_API_VERSION) {		// Free uivm now, so UI_SHUTDOWN doesn't get called later.		VM_Free( uivm );		uivm = NULL;		Com_Error( ERR_DROP, "User Interface is version %d, expected %d", v, UI_API_VERSION );		cls.uiStarted = qfalse;	}	else {		// init for this gamestate		VM_Call( uivm, UI_INIT, (clc.state >= CA_CONNECTING_NAT && clc.state < CA_ACTIVE) );	}}
开发者ID:d00man,项目名称:openarena-engine,代码行数:38,


示例9: SV_Auth_Ban_f

/*==================SV_Auth_Ban_fBan a user from the server and the group==================*/static void SV_Auth_Ban_f(void) {    client_t    *cl;    char        *d, *h, *m;    if (!com_sv_running->integer) {        Com_Printf("Server is not running./n");        return;    }    if (Cvar_VariableValue("auth") == 0) {        Com_Printf("Auth services are disabled/n");        return;    }    if (Cmd_Argc() < 5) {        Com_Printf ("Usage: auth-ban <client> <days> <hours> <mins>/n");        return;    }    cl = SV_GetPlayerByHandle();    if (!cl) {        return;    }    if (cl->netchan.remoteAddress.type == NA_LOOPBACK) {        SV_SendServerCommand(NULL, "print /"%s/"", "Cannot ban host client/n");        return;    }    d = Cmd_Argv(2);    h = Cmd_Argv(3);    m = Cmd_Argv(4);    VM_Call(gvm, GAME_AUTH_BAN, (int)(cl - svs.clients), atoi(d), atoi(h), atoi(m));}
开发者ID:CoolOppo,项目名称:ioq3-for-UrbanTerror-4,代码行数:46,


示例10: Cvar_Toggle_f

/*============Cvar_Toggle_fToggles a cvar for easy single key binding,optionally through a list of given values============*/void Cvar_Toggle_f( void ){    int        i, c;    const char *varname, *curval;    c = Cmd_Argc();    if ( c < 2 )    {        Cmd_PrintUsage(_("<variable> [<value> …]"), NULL);        return;    }    varname = Cmd_Argv( 1 );    if ( c == 2 )    {        Cvar_Set2( varname, va( "%d", !Cvar_VariableValue( varname ) ), qfalse );        return;    }    curval = Cvar_VariableString( Cmd_Argv( 1 ) );    // don't bother checking the last value for a match, since the desired    //  behaviour is the same as if the last value didn't match:    //  set the variable to the first value    for ( i = 2; i < c - 1; ++i )    {        if ( !strcmp( curval, Cmd_Argv( i ) ) )        {            Cvar_Set2( varname, Cmd_Argv( i + 1 ), qfalse );            return;        }    }    // fallback    Cvar_Set2( varname, Cmd_Argv( 2 ), qfalse );}
开发者ID:AlienHoboken,项目名称:Unvanquished,代码行数:46,


示例11: Cvar_Cycle_f

void Cvar_Cycle_f (void){	int i;	if (Cmd_Argc() < 3)	{		Con_Printf("cycle <cvar> <value list>: cycle cvar through a list of values/n");		return;	}	//loop through the args until you find one that matches the current cvar value.	//yes, this will get stuck on a list that contains the same value twice.	//it's not worth dealing with, and i'm not even sure it can be dealt with.	for (i=2;i<Cmd_Argc();i++)	{		//zero is assumed to be a string, even though it could actually be zero.  The worst case		//is that the first time you call this command, it won't match on zero when it should, but after that,		//it will be comparing strings that all had the same source (the user) so it will work.		if (atof(Cmd_Argv(i)) == 0)		{			if (!strcmp(Cmd_Argv(i), Cvar_VariableString(Cmd_Argv(1))))				break;		}		else		{			if (atof(Cmd_Argv(i)) == Cvar_VariableValue(Cmd_Argv(1)))				break;		}	}	if (i == Cmd_Argc())		Cvar_Set (Cmd_Argv(1), Cmd_Argv(2)); // no match	else if (i + 1 == Cmd_Argc())		Cvar_Set (Cmd_Argv(1), Cmd_Argv(2)); // matched last value in list	else		Cvar_Set (Cmd_Argv(1), Cmd_Argv(i+1)); // matched earlier in list}
开发者ID:ExperimentationBox,项目名称:Edenite,代码行数:38,


示例12: SV_Nextserver

void SV_Nextserver(void){    char * v;    //ZOID, ss_pic can be nextserver'd in coop mode    if (sv.state == ss_game || (sv.state == ss_pic && !Cvar_VariableValue("coop")))    {        return; // can't nextserver while playing a normal game    }    svs.spawncount++; // make sure another doesn't sneak in    v = Cvar_VariableString("nextserver");    if (!v[0])    {        Cbuf_AddText("killserver/n");    }    else    {        Cbuf_AddText(v);        Cbuf_AddText("/n");    }    Cvar_Set("nextserver", "");}
开发者ID:glampert,项目名称:quake2-for-ps2,代码行数:23,


示例13: R_CalcEntAlpha

/*=================R_CalcEntAlpha=================*/float R_CalcEntAlpha (float alpha, vec3_t point){	float	baseDist, newAlpha;	vec3_t	vert_len;	newAlpha = alpha;	if (!(currententity->renderfx & RF2_CAMERAMODEL) || !(currententity->flags & RF_TRANSLUCENT))	{		newAlpha = max(min(newAlpha, 1.0f), 0.0f);		return newAlpha;	}	baseDist = Cvar_VariableValue("cg_thirdperson_dist");	if (baseDist < 1)	baseDist = 50;	VectorSubtract(r_newrefdef.vieworg, point, vert_len);	newAlpha *= VectorLength(vert_len) / baseDist;	if (newAlpha > alpha)	newAlpha = alpha;	newAlpha = max(min(newAlpha, 1.0f), 0.0f);	return newAlpha;}
开发者ID:postfix,项目名称:quake2vr,代码行数:28,


示例14: Physics_Step

/*	Monsters freefall when they don't have a ground entity, otherwise	all movement is done with discrete steps.	This is also used for objects that have become still on the ground, but	will fall if the floor is pulled out from under them.*/void Physics_Step(edict_t *ent){	// Freefall if not onground	if(!(ent->v.flags & (FL_ONGROUND|FL_FLY|FL_SWIM)))	{#if 0		// [19/3/2013] TODO: Replace! ~hogsy		if(ent->v.velocity[2] < Cvar_VariableValue("server_gravityamount")*-0.1f)	//sv_gravity.value*-0.1f)			bHitSound = true;#endif		Game->Physics_SetGravity(ent);		Game->Physics_CheckVelocity(ent);		SV_FlyMove(ent,host_frametime,NULL);		SV_LinkEdict(ent,true);	}	// Regular thinking	Server_RunThink(ent);	Game->Physics_CheckWaterTransition(ent);}
开发者ID:Acidburn0zzz,项目名称:KatanaEngine,代码行数:29,


示例15: CL_InitUI

void CL_InitUI( void ) {	int		v;	vmInterpret_t		interpret;	// load the dll or bytecode	if ( cl_connectedToPureServer != 0 ) {		// if sv_pure is set we only allow qvms to be loaded		interpret = VMI_COMPILED;	}	else {		interpret = Cvar_VariableValue( "vm_ui" );	}	uivm = VM_Create( "ui", CL_UISystemCalls, interpret );	if ( !uivm ) {		Com_Error( ERR_FATAL, "VM_Create on UI failed" );	}	// sanity check	v = VM_Call( uivm, UI_GETAPIVERSION );	if (v == UI_OLD_API_VERSION) {//		Com_Printf(S_COLOR_YELLOW "WARNING: loading old Quake III Arena User Interface version %d/n", v );		// init for this gamestate		VM_Call( uivm, UI_INIT, (cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE));	}	else if (v != UI_API_VERSION) {		Com_Error( ERR_DROP, "User Interface is version %d, expected %d", v, UI_API_VERSION );		cls.uiStarted = qfalse;	}	else {		// init for this gamestate		VM_Call( uivm, UI_INIT, (cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE) );	}	// reset any CVAR_CHEAT cvars registered by ui	if ( !clc.demoplaying && !cl_connectedToCheatServer ) 		Cvar_SetCheatState();}
开发者ID:BruceJohnJennerLawso,项目名称:quake3,代码行数:37,


示例16: SoundSetMenuItemValues

static void SoundSetMenuItemValues( void ){	s_options_sound_sfxvolume_slider.curvalue		= Cvar_VariableValue( "s_volume" ) * 10;	s_options_sound_musicvolume_slider.curvalue	= Cvar_VariableValue( "s_musicvolume" ) * 10;	s_options_sound_oggmusic_box.curvalue			= (Cvar_VariableValue("cl_ogg_music") > 0);	s_options_sound_cdvolume_box.curvalue 		= !Cvar_VariableValue("cd_nocd");	//s_options_quality_list.curvalue			= !Cvar_VariableValue( "s_loadas8bit" );	//**  DMP convert setting into index for option display text	switch((int)Cvar_VariableValue("s_khz"))	{	case 48:  s_options_sound_quality_list.curvalue = 3;  break;	case 44:  s_options_sound_quality_list.curvalue = 2;  break;	case 22:  s_options_sound_quality_list.curvalue = 1;  break;	default:  s_options_sound_quality_list.curvalue = 0;  break;	}	//** DMP end sound menu changes	s_options_sound_compatibility_list.curvalue = Cvar_VariableValue( "s_primary");}
开发者ID:AimHere,项目名称:thirty-flights-of-linux,代码行数:18,


示例17: CL_FastForward_f

void CL_FastForward_f(void){	double t;	double wantedTime;	if (!clc.demoplaying)	{		Com_FuncPrinf("not playing demo can't fast forward/n");		return;	}	if (Cmd_Argc() < 2)	{		Com_FuncPrinf("usage:  fastforward <time in seconds>/n");		return;	}	if (!Q_isnumeric(Cmd_Argv(1)[0]))	{		t = Cvar_VariableValue(Cmd_Argv(1)) * 1000.0;	}	else	{		t = atof(Cmd_Argv(1)) * 1000.0;	}	if (cl.snap.serverTime)	{		wantedTime = (double)cl.serverTime + di.Overf + t;	}	else	{		wantedTime = (double)di.firstServerTime + t;	}	CL_DemoFastForward(wantedTime);}
开发者ID:dstaesse,项目名称:etlegacy,代码行数:37,


示例18: CL_InitUI

void CL_InitUI( void ) {	int		v;	vmInterpret_t		interpret;	// load the dll or bytecode	if ( cl_connectedToPureServer != 0 ) {		// if sv_pure is set we only allow qvms to be loaded		interpret = VMI_COMPILED;	}	else {		interpret = Cvar_VariableValue( "vm_ui" );	}	uivm = VM_Create( "ui", CL_UISystemCalls, interpret );	if ( !uivm ) {		Com_Error( ERR_FATAL, "VM_Create on UI failed" );	}	// sanity check	v = VM_Call( uivm, UI_GETAPIVERSION );#if !defined(RIM_NDK) && !defined(__QNXNTO__)    Com_Printf("WARNING: Igoring issue in CL_InitUI where ui versions don't match");#endif	if (v == UI_OLD_API_VERSION) {		Com_Printf("WARNING: loading old Quake III Arena User Interface version %d/n", v );		// init for this gamestate		VM_Call( uivm, UI_INIT, (cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE));	}	else if (v != UI_API_VERSION) {		Com_Error( ERR_DROP, "User Interface is version %d, expected %d", v, UI_API_VERSION );		cls.uiStarted = qfalse;	}	else {		// init for this gamestate		VM_Call( uivm, UI_INIT, (cls.state >= CA_AUTHORIZING && cls.state < CA_ACTIVE) );	}}
开发者ID:LoudHoward,项目名称:Quake3,代码行数:36,


示例19: Host_Exec_f

/*===============Host_Exec_f===============*/void Host_Exec_f( void ){	string	cfgpath;	char	*f;	if( Cmd_Argc() != 2 )	{		Msg( "Usage: exec <filename>/n" );		return;	}	// HACKHACK: don't execute listenserver.cfg in singleplayer	if( !Q_stricmp( Cvar_VariableString( "lservercfgfile" ),  Cmd_Argv( 1 )))	{		if( Cvar_VariableValue( "maxplayers" ) == 1.0f )			return;	}	Q_strncpy( cfgpath, Cmd_Argv( 1 ), sizeof( cfgpath )); 	FS_DefaultExtension( cfgpath, ".cfg" ); // append as default	f = (char *)FS_LoadFile( cfgpath, NULL, false );	if( !f )	{		MsgDev( D_NOTE, "couldn't exec %s/n", Cmd_Argv( 1 ));		return;	}	MsgDev( D_INFO, "execing %s/n", Cmd_Argv( 1 ));	// terminate the string with newline just in case it's missing	// insertion order is backwards from execution order	Cbuf_InsertText( "/n" );	Cbuf_InsertText( f );	Mem_Free( f );}
开发者ID:ptitSeb,项目名称:xash3d,代码行数:41,


示例20: CL_InitUI

void CL_InitUI( void ) {	int v;	vmInterpret_t interpret;	// load the dll or bytecode	interpret = Cvar_VariableValue("vm_ui");	if(cl_connectedToPureServer)	{		// if sv_pure is set we only allow qvms to be loaded		if(interpret != VMI_COMPILED && interpret != VMI_BYTECODE)			interpret = VMI_COMPILED;	}//----(SA)	always dll#ifdef WOLF_SP_DEMO	uivm = VM_Create( "ui", CL_UISystemCalls, VMI_NATIVE );#else	uivm = VM_Create( "ui", CL_UISystemCalls, interpret );#endif	if ( !uivm ) {		Com_Error( ERR_FATAL, "VM_Create on UI failed" );	}	// sanity check	v = VM_Call( uivm, UI_GETAPIVERSION );	if ( v != UI_API_VERSION ) {		Com_Error( ERR_FATAL, "User Interface is version %d, expected %d", v, UI_API_VERSION );		cls.uiStarted = qfalse;	}	// init for this gamestate//	VM_Call( uivm, UI_INIT );	VM_Call( uivm, UI_INIT, ( clc.state >= CA_AUTHORIZING && clc.state < CA_ACTIVE ) );}
开发者ID:MAN-AT-ARMS,项目名称:iortcw-archive,代码行数:36,


示例21: VID_MenuInit

/*** VID_MenuInit*/void VID_MenuInit( void ){	static const char *yesno_names[] =	{		"no",		"yes",		0	};	static const char *refs[] =	{		"[software      ]",		"[default OpenGL]",		"[3Dfx OpenGL   ]",		"[PowerVR OpenGL]",//		"[Rendition OpenGL]",		0	};	static const char *resolutions[] = 	{#include "../qcommon/vid_resolutions.h"	};	static const char *refreshrate_names[] = 	{		"[default]",		"[60Hz   ]",		"[70Hz   ]",		"[72Hz   ]",		"[75Hz   ]",		"[85Hz   ]",		"[100Hz  ]",		"[110Hz  ]",		"[120Hz  ]",		"[150Hz  ]",		0	};	static const char *filter_names[] =	{		"bilinear",		"trilinear",		0	};	int		i;	float	temp;	if ( !gl_driver )		gl_driver = Cvar_Get( "gl_driver", "opengl32", 0 );//	if ( !gl_picmip )//		gl_picmip = Cvar_Get( "gl_picmip", "0", 0 );//	if ( !gl_mode )//		gl_mode = Cvar_Get( "gl_mode", "3", 0 );//	if ( !sw_mode )//		sw_mode = Cvar_Get( "sw_mode", "3", 0 );//	if ( !gl_ext_palettedtexture )//		gl_ext_palettedtexture = Cvar_Get( "gl_ext_palettedtexture", "1", CVAR_ARCHIVE );//	if ( !gl_swapinterval )//		gl_swapinterval = Cvar_Get( "gl_swapinterval", "0", CVAR_ARCHIVE );//	if ( !sw_stipplealpha )//		sw_stipplealpha = Cvar_Get( "sw_stipplealpha", "0", CVAR_ARCHIVE );	temp = Cvar_VariableValue("sw_mode");	s_mode_list[SOFTWARE_MENU].curvalue = (temp == -1) ? 0 : max(temp - 2, 1);	// Knightmare- use offset of 2 because of hidden modes	temp = Cvar_VariableValue("gl_mode");	s_mode_list[OPENGL_MENU].curvalue = (temp == -1) ? 0 : max(temp - 2, 1);	// Knightmare- use offset of 2 because of hidden modes	if ( !scr_viewsize )		scr_viewsize = Cvar_Get ("viewsize", "100", CVAR_ARCHIVE);	s_screensize_slider[SOFTWARE_MENU].curvalue = Cvar_VariableValue("viewsize")/10;	s_screensize_slider[OPENGL_MENU].curvalue = Cvar_VariableValue("viewsize")/10;	if ( strcmp( Cvar_VariableString("vid_ref"), "soft" ) == 0 )	{		s_current_menu_index = SOFTWARE_MENU;		s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_SOFT;	}	else if ( strcmp( Cvar_VariableString("vid_ref"), "gl" ) == 0 )	{		s_current_menu_index = OPENGL_MENU;		if ( strcmp( Cvar_VariableString("gl_driver"), "3dfxgl" ) == 0 )			s_ref_list[s_current_menu_index].curvalue = REF_3DFX;		else if ( strcmp( Cvar_VariableString("gl_driver"), "pvrgl" ) == 0 )			s_ref_list[s_current_menu_index].curvalue = REF_POWERVR;		else if ( strcmp( Cvar_VariableString("gl_driver"), "opengl32" ) == 0 )			s_ref_list[s_current_menu_index].curvalue = REF_OPENGL;		else//			s_ref_list[s_current_menu_index].curvalue = REF_VERITE;			s_ref_list[s_current_menu_index].curvalue = REF_OPENGL;	}	s_software_menu.x = viddef.width * 0.50;	s_software_menu.y = viddef.height * 0.50 - 58;	s_software_menu.nitems = 0;	s_opengl_menu.x = viddef.width * 0.50;	s_opengl_menu.y = viddef.height * 0.50 - 58;	s_opengl_menu.nitems = 0;//.........这里部分代码省略.........
开发者ID:qbism,项目名称:qbq2,代码行数:101,


示例22: CL_UISystemCalls

/*====================CL_UISystemCallsThe ui module is making a system call====================*/intptr_t CL_UISystemCalls(intptr_t *args) {	switch(args[0]) {	//rww - alright, DO NOT EVER add a GAME/CGAME/UI generic call without adding a trap to match, and	//all of these traps must be shared and have cases in sv_game, cl_cgame, and cl_ui. They must also	//all be in the same order, and start at 100.	case TRAP_MEMSET:		Com_Memset(VMA(1), args[2], args[3]);		return 0;	case TRAP_MEMCPY:		Com_Memcpy(VMA(1), VMA(2), args[3]);		return 0;	case TRAP_STRNCPY:		return (intptr_t)strncpy((char *)VMA(1), (const char *)VMA(2), args[3]);	case TRAP_SIN:		return FloatAsInt(sin(VMF(1)));	case TRAP_COS:		return FloatAsInt(cos(VMF(1)));	case TRAP_ATAN2:		return FloatAsInt(atan2(VMF(1), VMF(2)));	case TRAP_SQRT:		return FloatAsInt(sqrt(VMF(1)));	case TRAP_MATRIXMULTIPLY:		MatrixMultiply((vec3_t *)VMA(1), (vec3_t *)VMA(2), (vec3_t *)VMA(3));		return 0;	case TRAP_ANGLEVECTORS:		AngleVectors((const float *)VMA(1), (float *)VMA(2), (float *)VMA(3), (float *)VMA(4));		return 0;	case TRAP_PERPENDICULARVECTOR:		PerpendicularVector((float *)VMA(1), (const float *)VMA(2));		return 0;	case TRAP_FLOOR:		return FloatAsInt(floor(VMF(1)));	case TRAP_CEIL:		return FloatAsInt(ceil(VMF(1)));	case TRAP_TESTPRINTINT:		return 0;	case TRAP_TESTPRINTFLOAT:		return 0;	case TRAP_ACOS:		return FloatAsInt(Q_acos(VMF(1)));	case TRAP_ASIN:		return FloatAsInt(Q_asin(VMF(1)));	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] );//.........这里部分代码省略.........
开发者ID:entdark,项目名称:jaMME,代码行数:101,


示例23: SVC_Info

/*================SVC_InfoResponds with a short info message that should be enough to determineif a user is interested in a server to do a full status================*/void SVC_Info( netadr_t from ) {	int		i, count, bots;	char	*gamedir;	char	infostring[MAX_INFO_STRING];	// ignore if we are in single player	if ( Cvar_VariableValue( "g_gametype" ) == GT_SINGLE_PLAYER || Cvar_VariableValue("ui_singlePlayerActive")) {		return;	}	/*	 * Check whether Cmd_Argv(1) has a sane length. This was not done in the original Quake3 version which led	 * to the Infostring bug discovered by Luigi Auriemma. See http://aluigi.altervista.org/ for the advisory.	 */	// A maximum challenge length of 128 should be more than plenty.	if(strlen(Cmd_Argv(1)) > 128)		return;	// don't count privateclients	count = 0;	bots = 0;	for ( i = sv_privateClients->integer ; i < sv_maxclients->integer ; i++ ) {		if ( svs.clients[i].state >= CS_CONNECTED ) {			count++;			if (svs.clients[i].netchan.remoteAddress.type == NA_BOT)				bots++;		}	}	infostring[0] = 0;	// echo back the parameter to status. so servers can use it as a challenge	// to prevent timed spoofed reply packets that add ghost servers	Info_SetValueForKey( infostring, "challenge", Cmd_Argv(1) );	Info_SetValueForKey( infostring, "protocol", va("%i", PROTOCOL_VERSION) );	Info_SetValueForKey( infostring, "hostname", sv_hostname->string );	Info_SetValueForKey( infostring, "mapname", sv_mapname->string );	Info_SetValueForKey( infostring, "clients", va("%i", count) );	Info_SetValueForKey( infostring, "bots", va("%i", bots) );	Info_SetValueForKey( infostring, "sv_maxclients",		va("%i", sv_maxclients->integer - sv_privateClients->integer ) );	Info_SetValueForKey( infostring, "gametype", va("%i", sv_gametype->integer ) );	Info_SetValueForKey( infostring, "pure", va("%i", sv_pure->integer ) );		//@Barbatos	#ifdef USE_AUTH	Info_SetValueForKey( infostring, "auth", Cvar_VariableString("auth") );	#endif	//@Barbatos: if it's a passworded server, let the client know (for the server browser)	if(Cvar_VariableValue("g_needpass") == 1)		Info_SetValueForKey( infostring, "password", va("%i", 1));			if( sv_minPing->integer ) {		Info_SetValueForKey( infostring, "minPing", va("%i", sv_minPing->integer) );	}	if( sv_maxPing->integer ) {		Info_SetValueForKey( infostring, "maxPing", va("%i", sv_maxPing->integer) );	}	gamedir = Cvar_VariableString( "fs_game" );	if( *gamedir ) {		Info_SetValueForKey( infostring, "game", gamedir );	}	Info_SetValueForKey(infostring, "modversion", Cvar_VariableString("g_modversion"));	NET_OutOfBandPrint( NS_SERVER, from, "infoResponse/n%s", infostring );}
开发者ID:Barbatos,项目名称:ioq3-for-UrbanTerror-4,代码行数:79,


示例24: SV_SpawnServer

/*================SV_SpawnServerChange the server to a new map, taking all connectedclients along with it.This is NOT called for map_restart================*/void SV_SpawnServer( char *server, qboolean killBots ){	int        i;	int        checksum;	qboolean   isBot;	const char *p;	// shut down the existing game if it is running	SV_ShutdownGameProgs();	Com_Printf( "------ Server Initialization ------/n" );	Com_Printf( "Server: %s/n", server );	// if not running a dedicated server CL_MapLoading will connect the client to the server	// also print some status stuff	CL_MapLoading();	// make sure all the client stuff is unloaded	CL_ShutdownAll();	// clear the whole hunk because we're (re)loading the server	Hunk_Clear();	// clear collision map data     // (SA) NOTE: TODO: used in missionpack	CM_ClearMap();	// wipe the entire per-level structure	SV_ClearServer();	// MrE: main zone should be pretty much emtpy at this point	// except for file system data and cached renderer data	Z_LogHeap();	// allocate empty config strings	for ( i = 0; i < MAX_CONFIGSTRINGS; i++ )	{		sv.configstrings[ i ] = CopyString( "" );		sv.configstringsmodified[ i ] = qfalse;	}	// init client structures and svs.numSnapshotEntities	if ( !Cvar_VariableValue( "sv_running" ) )	{		SV_Startup();	}	else	{		// check for maxclients change		if ( sv_maxclients->modified )		{			SV_ChangeMaxClients();		}#ifdef USE_HUB_SERVER		// if sv_owHubHost was changed, resolve the address again		if ( sv_owHubHost->modified )		{			sv_owHubHost->modified = qfalse;			SV_ResolveowHubHost();		}#endif	}	// clear pak references	FS_ClearPakReferences( 0 );	// allocate the snapshot entities on the hunk	svs.snapshotEntities = Hunk_Alloc( sizeof( entityState_t ) * svs.numSnapshotEntities, h_high );	svs.nextSnapshotEntities = 0;	// toggle the server bit so clients can detect that a	// server has changed	svs.snapFlagServerBit ^= SNAPFLAG_SERVERCOUNT;	// set nextmap to the same map, but it may be overriden	// by the game startup or another console command	Cvar_Set( "nextmap", "map_restart 0" );//  Cvar_Set( "nextmap", va("map %s", server) );	// Ridah	// DHM - Nerve :: We want to use the completion bar in multiplayer as well	// Arnout: just always use it//  if( !SV_GameIsSinglePlayer() ) {	SV_SetExpectedHunkUsage( va( "maps/%s.bsp", server ) );//  } else {	// just set it to a negative number,so the cgame knows not to draw the percent bar//      Cvar_Set( "com_expectedhunkusage", "-1" );//  }//.........这里部分代码省略.........
开发者ID:SHOVELL,项目名称:Unvanquished,代码行数:101,


示例25: SV_MapRestart_f

/*================SV_MapRestart_fCompletely restarts a level, but doesn't send a new gamestate to the clients.This allows fair starts with variable load times.================*/static void SV_MapRestart_f( void ) {	int			i;	client_t	*client;	char		*denied;	int			delay;	// make sure we aren't restarting twice in the same frame	if ( com_frameTime == sv.serverId ) {		return;	}	// make sure server is running	if ( !com_sv_running->integer ) {		Com_Printf( "Server is not running./n" );		return;	}	if ( sv.restartTime ) {		return;	}	if (Cmd_Argc() > 1 ) {		delay = atoi( Cmd_Argv(1) );	}	else {		delay = 5;	}	if( delay && !Cvar_VariableValue("g_doWarmup") ) {		sv.restartTime = sv.time + delay * 1000;		SV_SetConfigstring( CS_WARMUP, va("%i", sv.restartTime) );		return;	}	// check for changes in variables that can't just be restarted	// check for maxclients change	if ( sv_maxclients->modified ) {		char	mapname[MAX_QPATH];		Com_Printf( "variable change -- restarting./n" );		// restart the map the slow way		Q_strncpyz( mapname, Cvar_VariableString( "mapname" ), sizeof( mapname ) );		SV_SpawnServer( mapname, qfalse );		return;	}	// toggle the server bit so clients can detect that a	// map_restart has happened	svs.snapFlagServerBit ^= SNAPFLAG_SERVERCOUNT;	// generate a new serverid		// TTimo - don't update restartedserverId there, otherwise we won't deal correctly with multiple map_restart	sv.serverId = com_frameTime;	Cvar_Set( "sv_serverid", va("%i", sv.serverId ) );	// if a map_restart occurs while a client is changing maps, we need	// to give them the correct time so that when they finish loading	// they don't violate the backwards time check in cl_cgame.c	for (i=0 ; i<sv_maxclients->integer ; i++) {		if (svs.clients[i].state == CS_PRIMED) {			svs.clients[i].oldServerTime = sv.restartTime;		}	}	// reset all the vm data in place without changing memory allocation	// note that we do NOT set sv.state = SS_LOADING, so configstrings that	// had been changed from their default values will generate broadcast updates	sv.state = SS_LOADING;	sv.restarting = qtrue;	SV_RestartGameProgs();	// run a few frames to allow everything to settle	for (i = 0; i < 3; i++)	{		VM_Call (gvm, GAME_RUN_FRAME, sv.time);		sv.time += 100;		svs.time += 100;	}	sv.state = SS_GAME;	sv.restarting = qfalse;	// connect and begin all the clients	for (i=0 ; i<sv_maxclients->integer ; i++) {		client = &svs.clients[i];		// send the new gamestate to all connected clients		if ( client->state < CS_CONNECTED) {			continue;		}//.........这里部分代码省略.........
开发者ID:mtiusane,项目名称:new-edge,代码行数:101,


示例26: int

vm_t *VM_Create( const char *module, int (*systemCalls)(int *), 				vmInterpret_t interpret ) {	vm_t		*vm;	vmHeader_t	*header;	int			length;	int			dataLength;	int			i, remaining;	char		filename[MAX_QPATH];	if ( !module || !module[0] || !systemCalls ) {		Com_Error( ERR_FATAL, "VM_Create: bad parms" );	}	remaining = Hunk_MemoryRemaining();	// see if we already have the VM	for ( i = 0 ; i < MAX_VM ; i++ ) {		if (!Q_stricmp(vmTable[i].name, module)) {			vm = &vmTable[i];			return vm;		}	}	// find a free vm	for ( i = 0 ; i < MAX_VM ; i++ ) {		if ( !vmTable[i].name[0] ) {			break;		}	}	if ( i == MAX_VM ) {		Com_Error( ERR_FATAL, "VM_Create: no free vm_t" );	}	vm = &vmTable[i];	Q_strncpyz( vm->name, module, sizeof( vm->name ) );	vm->systemCall = systemCalls;	// never allow dll loading with a demo	if ( interpret == VMI_NATIVE ) {		if ( Cvar_VariableValue( "fs_restrict" ) ) {			interpret = VMI_COMPILED;		}	}	if ( interpret == VMI_NATIVE ) {		// try to load as a system dll		Com_Printf( "Loading dll file %s./n", vm->name );		vm->dllHandle = Sys_LoadDll( module, vm->fqpath , &vm->entryPoint, VM_DllSyscall );		if ( vm->dllHandle ) {			return vm;		}		Com_Printf( "Failed to load dll, looking for qvm./n" );		interpret = VMI_COMPILED;	}	// load the image	Com_sprintf( filename, sizeof(filename), "vm/%s.qvm", vm->name );	Com_Printf( "Loading vm file %s./n", filename );	length = FS_ReadFile( filename, (void **)&header );	if ( !header ) {		Com_Printf( "Failed./n" );		VM_Free( vm );		return NULL;	}	// byte swap the header	for ( i = 0 ; i < sizeof( *header ) / 4 ; i++ ) {		((int *)header)[i] = LittleLong( ((int *)header)[i] );	}	// validate	if ( header->vmMagic != VM_MAGIC		|| header->bssLength < 0 		|| header->dataLength < 0 		|| header->litLength < 0 		|| header->codeLength <= 0 ) {		VM_Free( vm );		Com_Error( ERR_FATAL, "%s has bad header", filename );	}	// round up to next power of 2 so all data operations can	// be mask protected	dataLength = header->dataLength + header->litLength + header->bssLength;	for ( i = 0 ; dataLength > ( 1 << i ) ; i++ ) {	}	dataLength = 1 << i;	// allocate zero filled space for initialized and uninitialized data	vm->dataBase = Hunk_Alloc( dataLength, h_high );	vm->dataMask = dataLength - 1;	// copy the intialized data	Com_Memcpy( vm->dataBase, (byte *)header + header->dataOffset, header->dataLength + header->litLength );	// byte swap the longs	for ( i = 0 ; i < header->dataLength ; i += 4 ) {		*(int *)(vm->dataBase + i) = LittleLong( *(int *)(vm->dataBase + i ) );//.........这里部分代码省略.........
开发者ID:LoudHoward,项目名称:Quake3,代码行数:101,


示例27: ScreenSetMenuItemValues

static void ScreenSetMenuItemValues( void ){	Cvar_SetValue( "crosshair", ClampCvar( 0, 100, Cvar_VariableValue("crosshair") ) );	//s_options_crosshair_box.curvalue			= Cvar_VariableValue("crosshair");	SetCrosshairCursor();	Cvar_SetValue( "crosshair_scale", ClampCvar( 0.25, 3, Cvar_VariableValue("crosshair_scale") ) );	s_options_screen_crosshairscale_slider.curvalue	= Cvar_VariableValue("crosshair_scale")*4;	Cvar_SetValue( "crosshair_alpha", ClampCvar( 0.05, 1, Cvar_VariableValue("crosshair_alpha") ) );	s_options_screen_crosshairalpha_slider.curvalue	= Cvar_VariableValue("crosshair_alpha")*20;	Cvar_SetValue( "crosshair_pulse", ClampCvar( 0, 0.5, Cvar_VariableValue("crosshair_pulse") ) );	s_options_screen_crosshairpulse_slider.curvalue	= Cvar_VariableValue("crosshair_pulse")*20;	Cvar_SetValue( "hud_scale", ClampCvar( 0, 7, Cvar_VariableValue("hud_scale") ) );	s_options_screen_hudscale_slider.curvalue		= Cvar_VariableValue("hud_scale")+1;	Cvar_SetValue( "hud_alpha", ClampCvar( 0, 1, Cvar_VariableValue("hud_alpha") ) );	s_options_screen_hudalpha_slider.curvalue		= Cvar_VariableValue("hud_alpha")*10 + 1;	Cvar_SetValue( "hud_squeezedigits", ClampCvar( 0, 1, Cvar_VariableValue("hud_squeezedigits") ) );	s_options_screen_hudsqueezedigits_box.curvalue	= Cvar_VariableValue("hud_squeezedigits");	Cvar_SetValue( "cl_drawfps", ClampCvar( 0, 1, Cvar_VariableValue("cl_drawfps") ) );	s_options_screen_fps_box.curvalue				= Cvar_VariableValue("cl_drawfps");}
开发者ID:Kiln707,项目名称:KMQuake2,代码行数:27,


示例28: SV_SpawnServer

/*================SV_SpawnServerChange the server to a new map, taking all connectedclients along with it.This is NOT called for map_restart================*/void SV_SpawnServer( char *server, qboolean killBots ) {    int			i;    int			checksum;    qboolean	isBot;    char		systemInfo[16384];    const char	*p;    // shut down the existing game if it is running    SV_ShutdownGameProgs();    Com_Printf ("------ Server Initialization ------/n");    Com_Printf ("Server: %s/n",server);    // if not running a dedicated server CL_MapLoading will connect the client to the server    // also print some status stuff    CL_MapLoading();    // make sure all the client stuff is unloaded    CL_ShutdownAll();    // clear the whole hunk because we're (re)loading the server    Hunk_Clear();    // clear collision map data    CM_ClearMap();    // init client structures and svs.numSnapshotEntities    if ( !Cvar_VariableValue("sv_running") ) {        SV_Startup();    } else {        // check for maxclients change        if ( sv_maxclients->modified ) {            SV_ChangeMaxClients();        }    }    // clear pak references    FS_ClearPakReferences(0);    // allocate the snapshot entities on the hunk    svs.snapshotEntities = Hunk_Alloc( sizeof(entityState_t)*svs.numSnapshotEntities, h_high );    svs.nextSnapshotEntities = 0;    // toggle the server bit so clients can detect that a    // server has changed    svs.snapFlagServerBit ^= SNAPFLAG_SERVERCOUNT;    // set nextmap to the same map, but it may be overriden    // by the game startup or another console command    Cvar_Set( "nextmap", "map_restart 0");//	Cvar_Set( "nextmap", va("map %s", server) );    // wipe the entire per-level structure    SV_ClearServer();    for ( i = 0 ; i < MAX_CONFIGSTRINGS ; i++ ) {        sv.configstrings[i] = CopyString("");    }    // make sure we are not paused    Cvar_Set("cl_paused", "0");    // get a new checksum feed and restart the file system    srand(Com_Milliseconds());    sv.checksumFeed = ( ((int) rand() << 16) ^ rand() ) ^ Com_Milliseconds();    FS_Restart( sv.checksumFeed );    CM_LoadMap( va("maps/%s.bsp", server), qfalse, &checksum );    // set serverinfo visible name    Cvar_Set( "mapname", server );    Cvar_Set( "sv_mapChecksum", va("%i",checksum) );    // serverid should be different each time    sv.serverId = com_frameTime;    sv.restartedServerId = sv.serverId; // I suppose the init here is just to be safe    sv.checksumFeedServerId = sv.serverId;    Cvar_Set( "sv_serverid", va("%i", sv.serverId ) );    // clear physics interaction links    SV_ClearWorld ();    // media configstring setting should be done during    // the loading stage, so connected clients don't have    // to load during actual gameplay    sv.state = SS_LOADING;    // load and spawn all other entities    SV_InitGameProgs();    // don't allow a map_restart if game is modified//.........这里部分代码省略.........
开发者ID:Avatarchik,项目名称:Quake-III-Arena-D3D11,代码行数:101,


示例29: CL_UISystemCalls

/*====================CL_UISystemCallsThe 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", VMA(1) );		return 0;	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_SET:		Cvar_Set( (const char *) VMA(1), (const char *) VMA(2) );		return 0;	case UI_CVAR_SETVALUE:		Cvar_SetValue( (const char *) VMA(1), VMF(2) );		return 0;	case UI_CVAR_UPDATE:		Cvar_Update( (vmCvar_t *) VMA(1) );		return 0;	case UI_R_REGISTERMODEL:		return re.RegisterModel((const char *) VMA(1) );	case UI_R_REGISTERSHADERNOMIP:		return re.RegisterShaderNoMip((const char *) VMA(1) );	case UI_GETGLCONFIG:		CL_GetGlconfig( ( glconfig_t *) VMA(1) );		return 0;	case UI_CMD_EXECUTETEXT:		Cbuf_ExecuteText( args[1], (const char *) VMA(2) );		return 0;	case UI_CVAR_VARIABLEVALUE:		return FloatAsInt( Cvar_VariableValue( (const char *) VMA(1) ) );	case UI_FS_GETFILELIST:		return FS_GetFileList( (const char *) VMA(1), (const char *) VMA(2), (char *) VMA(3), args[4] );	case UI_KEY_SETCATCHER:		Key_SetCatcher( args[1] );		return 0;	case UI_KEY_CLEARSTATES:		Key_ClearStates();		return 0;	case UI_R_SETCOLOR:		re.SetColor( (const float *) VMA(1) );		return 0;	case UI_R_DRAWSTRETCHPIC:		re.DrawStretchPic( VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9] );		return 0;	case UI_CVAR_VARIABLESTRINGBUFFER:		Cvar_VariableStringBuffer( (const char *) VMA(1), (char *) VMA(2), args[3] );		return 0;  case UI_R_MODELBOUNDS:		re.ModelBounds( args[1], (float *) VMA(2),(float *) VMA(3) );		return 0;	case UI_R_CLEARSCENE:		re.ClearScene();		return 0;//	case UI_KEY_GETOVERSTRIKEMODE://		return Key_GetOverstrikeMode();//		return 0;//	case UI_PC_READ_TOKEN://		return PC_ReadTokenHandle( args[1], VMA(2) );		//	case UI_PC_SOURCE_FILE_AND_LINE://		return PC_SourceFileAndLine( args[1], VMA(2), VMA(3) );	case UI_KEY_GETCATCHER:		return Key_GetCatcher();	case UI_MILLISECONDS:		return Sys_Milliseconds();	case UI_S_REGISTERSOUND:		return S_RegisterSound((const char *) VMA(1));	case UI_S_STARTLOCALSOUND://.........这里部分代码省略.........
开发者ID:Elfmagi,项目名称:OpenJK,代码行数:101,


示例30: ApplyChanges

//.........这里部分代码省略.........		break;	case 7:		Cvar_SetValue ("r_displayrefresh", 110);		break;	case 6:		Cvar_SetValue ("r_displayrefresh", 100);		break;	case 5:		Cvar_SetValue ("r_displayrefresh", 85);		break;	case 4:		Cvar_SetValue ("r_displayrefresh", 75);		break;	case 3:		Cvar_SetValue ("r_displayrefresh", 72);		break;	case 2:		Cvar_SetValue ("r_displayrefresh", 70);		break;	case 1:		Cvar_SetValue ("r_displayrefresh", 60);		break;	case 0:	default:		Cvar_SetValue ("r_displayrefresh", 0);		break;	}	// Knightmare- texture filter mode	if (s_texfilter_box.curvalue == 1)		Cvar_Set ("r_texturemode", "GL_LINEAR_MIPMAP_LINEAR");	else // (s_texfilter_box.curvalue == 0)		Cvar_Set ("r_texturemode", "GL_LINEAR_MIPMAP_NEAREST");	// Knightmare- anisotropic filtering	switch ((int)s_aniso_box.curvalue)	{		case 1: Cvar_SetValue ("gl_anisotropic", 2.0); break;		case 2: Cvar_SetValue ("gl_anisotropic", 4.0); break;		case 3: Cvar_SetValue ("gl_anisotropic", 8.0); break;		case 4: Cvar_SetValue ("gl_anisotropic", 16.0); break;		default:		case 0: Cvar_SetValue ("gl_anisotropic", 0.0); break;	}	switch ( s_ref_list[s_current_menu_index].curvalue )	{	case REF_SOFT:		Cvar_Set( "vid_ref", "soft" );		break;	case REF_OPENGL:		Cvar_Set( "vid_ref", "gl" );		Cvar_Set( "gl_driver", "opengl32" );		break;	case REF_3DFX:		Cvar_Set( "vid_ref", "gl" );		Cvar_Set( "gl_driver", "3dfxgl" );		break;	case REF_POWERVR:		Cvar_Set( "vid_ref", "gl" );		Cvar_Set( "gl_driver", "pvrgl" );		break;	case REF_VERITE:		Cvar_Set( "vid_ref", "gl" );		Cvar_Set( "gl_driver", "veritegl" );		break;	}	/*	** update appropriate stuff if we're running OpenGL and gamma	** has been modified	*/	if ( Q_strcasecmp( Cvar_VariableString("vid_ref"), "gl" ) == 0 )	{		if ( vid_gamma->modified )		{			vid_ref->modified = true;			if ( Q_strcasecmp( Cvar_VariableString("gl_driver"), "3dfxgl" ) == 0 )			{				char envbuffer[1024];				float g;				vid_ref->modified = true;				g = 2.00 * ( 0.8 - ( Cvar_VariableValue("vid_gamma") - 0.5 ) ) + 1.0F;				Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g );				putenv( envbuffer );				Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );				putenv( envbuffer );				vid_gamma->modified = false;			}		}		if ( gl_driver->modified )			vid_ref->modified = true;	}	M_ForceMenuOff();}
开发者ID:qbism,项目名称:qbq2,代码行数:101,



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


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