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

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

51自学网 2021-06-03 08:57:33
  C++
这篇教程C++ trap_Cvar_SetValue函数代码示例写得很实用,希望能帮到您。

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

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

示例1: Controls_SetConfig

/*=================Controls_SetConfig=================*/static void Controls_SetConfig( void ){	int		i;	bind_t*	bindptr;	// set the bindings from the local store	bindptr = g_bindings;	// iterate each command, get its numeric binding	for (i=0; ;i++,bindptr++)	{		if (!bindptr->label)			break;		if (bindptr->bind1 != -1)		{				trap_Key_SetBinding( bindptr->bind1, bindptr->command );			if (bindptr->bind2 != -1)				trap_Key_SetBinding( bindptr->bind2, bindptr->command );		}	}	if ( s_controls.invertmouse.curvalue )		trap_Cvar_SetValue( "m_pitch", -fabs( trap_Cvar_VariableValue( "m_pitch" ) ) );	else		trap_Cvar_SetValue( "m_pitch", fabs( trap_Cvar_VariableValue( "m_pitch" ) ) );	trap_Cvar_SetValue( "m_filter", s_controls.smoothmouse.curvalue );	trap_Cvar_SetValue( "cg_autoswitch", s_controls.autoswitch.curvalue );	trap_Cvar_SetValue( "sensitivity", s_controls.sensitivity.curvalue );	trap_Cmd_ExecuteText( EXEC_APPEND, "in_restart/n" );}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:38,


示例2: BotInterbreeding

/*==============BotInterbreeding==============*/void BotInterbreeding(void) {	int i;	trap_Cvar_Update(&bot_interbreedchar);	if (!strlen(bot_interbreedchar.string)) return;	//make sure we are in tournament mode	if (gametype != GT_TOURNAMENT) {		trap_Cvar_SetValue("g_gametype", GT_TOURNAMENT);		ExitLevel();		return;	}	//shutdown all the bots	for (i = 0; i < MAX_CLIENTS; i++) {		if (botstates[i] && botstates[i]->inuse) {			BotAIShutdownPlayer(botstates[i]->playernum, qfalse);		}	}	//make sure all item weight configs are reloaded and Not shared	trap_Cvar_SetValue("bot_reloadcharacters", 1);	//add a number of bots using the desired bot character	for (i = 0; i < bot_interbreedbots.integer; i++) {		trap_Cmd_ExecuteText( EXEC_INSERT, va("addbot %s 4 free %i %s%d/n",						bot_interbreedchar.string, i * 50, bot_interbreedchar.string, i) );	}	//	trap_Cvar_Set("bot_interbreedchar", "");	bot_interbreed = qtrue;}
开发者ID:SilverlineDev,项目名称:mint-arena,代码行数:33,


示例3: UI_SPArena_Start

void UI_SPArena_Start( const char *arenaInfo ) {	char	*map;	int		level;	int		n;	char	*txt;	n = (int)trap_Cvar_VariableValue( "sv_maxclients" );	if ( n < 8 ) {		trap_Cvar_SetValue( "sv_maxclients", 8 );	}	level = atoi( Info_ValueForKey( arenaInfo, "num" ) );	txt = Info_ValueForKey( arenaInfo, "special" );	if( txt[0] ) {		if( Q_stricmp( txt, "training" ) == 0 ) {			level = -4;		}		else if( Q_stricmp( txt, "final" ) == 0 ) {			level = UI_GetNumSPTiers() * ARENAS_PER_TIER;		}	}	trap_Cvar_SetValue( "ui_spSelection", level );	map = Info_ValueForKey( arenaInfo, "map" );	trap_Cmd_ExecuteText( EXEC_APPEND, va( "spmap %s/n", map ) );}
开发者ID:ET-NiK,项目名称:amxxgroup,代码行数:26,


示例4: StartServerActionFunc

static void StartServerActionFunc( menucommon_t *unused ){    char *str;    char mapname[MAX_CONFIGSTRING_CHARS];    char starservercmd[MAX_STRING_CHARS];    m_listitem_t *mapitem;    mapitem = UI_FindItemInScrollListWithId( &mapList, mapList_cur_idx );    if( !mapitem || !mapitem->name )        return;    trap_Cvar_Set( "g_gametype", startserver_gametype_names[m_gametype] );    trap_Cvar_SetValue( "sv_skilllevel", m_skill );    trap_Cvar_SetValue( "sv_cheats", m_cheats );    trap_Cvar_SetValue( "sv_public", m_public );    str = UI_GetMenuitemFieldBuffer( UI_MenuItemByName( "m_startserver_hostname" ) );    if( str ) trap_Cvar_Set( "sv_hostname", str );    str = UI_GetMenuitemFieldBuffer( UI_MenuItemByName( "m_startserver_maxplayers" ) );    if( str ) trap_Cvar_Set( "sv_maxclients", str );    // game stuff, overriding local gametype config    starservercmd[0] = '/0';    Q_strncatz( starservercmd, va( "g_instagib %i;", m_instagib ), sizeof( starservercmd ) );    trap_Cvar_SetValue( "g_instagib", (float)m_instagib );    str = UI_GetMenuitemFieldBuffer( UI_MenuItemByName( "m_startserver_timelimit" ) );    if( str )    {        Q_strncatz( starservercmd, va( "g_timelimit %s;", str ), sizeof( starservercmd ) );        trap_Cvar_Set( "g_timelimit", str );    }    str = UI_GetMenuitemFieldBuffer( UI_MenuItemByName( "m_startserver_scorelimit" ) );    if( str )    {        Q_strncatz( starservercmd, va( "g_scorelimit %s;", str ), sizeof( starservercmd ) );        trap_Cvar_Set( "g_scorelimit", str );    }    str = UI_GetMenuitemFieldBuffer( UI_MenuItemByName( "m_startserver_numbots" ) );    if( str )    {        Q_strncatz( starservercmd, va( "g_numbots %s;", str ), sizeof( starservercmd ) );        trap_Cvar_Set( "g_numbots", str );    }    trap_Cvar_ForceSet( "ui_startservercmd", starservercmd );    if( uis.serverState )        trap_Cmd_ExecuteText( EXEC_APPEND, "disconnect/n" );    if( trap_ML_GetMapByNum( (int)((size_t)mapitem->data), mapname, sizeof( mapname ) ) )        trap_Cvar_ForceSet( "ui_startserver_lastselectedmap", mapname );    trap_Cmd_ExecuteText( EXEC_APPEND, va( "map /"%s/"/n", mapitem->name ) );}
开发者ID:Racenet,项目名称:racesow,代码行数:58,


示例5: UI_DisplayOptionsMenu_Event

/*=================UI_DisplayOptionsMenu_Event=================*/static void UI_DisplayOptionsMenu_Event( void* ptr, int event ) {	if( event != QM_ACTIVATED ) {		return;	}	switch( ((menucommon_s*)ptr)->id ) {	case ID_GRAPHICS:		UI_PopMenu();		UI_GraphicsOptionsMenu();		break;	case ID_DISPLAY:		break;	case ID_SOUND:		UI_PopMenu();		UI_SoundOptionsMenu();		break;	case ID_NETWORK:		UI_PopMenu();		UI_NetworkOptionsMenu();		break;	case ID_BRIGHTNESS:		trap_Cvar_SetValue( "r_gamma", displayOptionsInfo.brightness.curvalue / 10.0f );		break;		case ID_IGNOREHWG:		trap_Cvar_SetValue( "r_ignorehwgamma", displayOptionsInfo.ignoreHWG.curvalue );		trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart/n" );		break;	case ID_BACK:		UI_PopMenu();		break;	case ID_ANAGLYPH:		trap_Cvar_SetValue( "r_anaglyphMode", displayOptionsInfo.anaglyph.curvalue );		if ( !displayOptionsInfo.anaglyph.curvalue ) {			displayOptionsInfo.greyscale.generic.flags |= QMF_GRAYED;		}		else {			displayOptionsInfo.greyscale.generic.flags &= ~QMF_GRAYED;		}		break;	case ID_GREYSCALE:		trap_Cvar_SetValue( "r_greyscale", ( displayOptionsInfo.greyscale.curvalue / 100.0f ) );		displayOptionsInfo.apply.generic.flags &= ~( QMF_HIDDEN | QMF_INACTIVE );		break;	}}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:58,


示例6: UI_NetworkOptionsMenu_Event

/*=================UI_NetworkOptionsMenu_Event=================*/static void UI_NetworkOptionsMenu_Event( void* ptr, int event ) {	if( event != QM_ACTIVATED ) 	{		return;	}	switch( ((menucommon_s*)ptr)->id ) 	{	case ID_GRAPHICS:		UI_PopMenu();		UI_VideoDataMenu();		// Move to the Video Menu		break;	case ID_DISPLAY:		UI_PopMenu();		UI_VideoDataMenu();		// Move to the Video Menu		break;	case ID_SOUND:		UI_PopMenu();//		UI_SoundOptionsMenu();		break;	case ID_NETWORK:		break;	case ID_RATE:		if( networkOptionsInfo.rate.curvalue == 0 ) 		{			trap_Cvar_SetValue( "rate", 2500 );		}		else if( networkOptionsInfo.rate.curvalue == 1 ) 		{			trap_Cvar_SetValue( "rate", 3000 );		}		else if( networkOptionsInfo.rate.curvalue == 2 ) 		{			trap_Cvar_SetValue( "rate", 4000 );		}		else if( networkOptionsInfo.rate.curvalue == 3 ) 		{			trap_Cvar_SetValue( "rate", 5000 );		}		else if( networkOptionsInfo.rate.curvalue == 4 ) 		{			trap_Cvar_SetValue( "rate", 25000 );		}		break;	}}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:57,


示例7: CG_CameraOrbit

static void CG_CameraOrbit( int speed, int delay ) {	int i;	trap_Cvar_SetValue( "cg_cameraOrbit", speed );	if ( delay > 0 ) {		trap_Cvar_SetValue( "cg_cameraOrbitDelay", delay );	}	for ( i = 0; i < CG_MaxSplitView(); i++ ) {		trap_Cvar_SetValue(Com_LocalPlayerCvarName( i, "cg_thirdPerson" ), speed == 0 ? 0 : 1 );		trap_Cvar_SetValue(Com_LocalPlayerCvarName( i, "cg_thirdPersonAngle" ), 0 );		trap_Cvar_SetValue(Com_LocalPlayerCvarName( i, "cg_thirdPersonRange" ), 100 );	}}
开发者ID:coltongit,项目名称:mint-arena-you-will-never-win,代码行数:14,


示例8: FirstConnect_Event

/*=================FirstConnect_Event=================*/static void FirstConnect_Event( void* ptr, int event ){	switch (((menucommon_s*)ptr)->id)	{		case ID_GO:			if (event != QM_ACTIVATED)				break;                        FirstConnect_SaveChanges();                        UI_PopMenu();                        trap_Cvar_SetValue( "ui_setupchecked", 1 );                        UI_ArenaServersMenu();			break;		case ID_BACK:			if (event != QM_ACTIVATED)				break;			UI_PopMenu();			break;                case ID_RATE:                        if( s_firstconnect.rate.curvalue == 0 ) {                                trap_Cvar_SetValue( "rate", 2500 );                        }                        else if( s_firstconnect.rate.curvalue == 1 ) {                                trap_Cvar_SetValue( "rate", 3000 );                        }                        else if( s_firstconnect.rate.curvalue == 2 ) {                                trap_Cvar_SetValue( "rate", 4000 );                        }                        else if( s_firstconnect.rate.curvalue == 3 ) {                                trap_Cvar_SetValue( "rate", 5000 );                        }                        else if( s_firstconnect.rate.curvalue == 4 ) {                                trap_Cvar_SetValue( "rate", 25000 );                        }                        break;                case ID_ALLOWDOWNLOAD:                        trap_Cvar_SetValue( "cl_allowDownload", s_firstconnect.allowdownload.curvalue );                        trap_Cvar_SetValue( "sv_allowDownload", s_firstconnect.allowdownload.curvalue );                        break;                case ID_DELAGHITSCAN:                        trap_Cvar_SetValue( "g_delagHitscan", s_firstconnect.delaghitscan.curvalue );                        trap_Cvar_SetValue( "cg_delag", s_firstconnect.delaghitscan.curvalue );                        break;	}}
开发者ID:OpenArena,项目名称:legacy,代码行数:54,


示例9: UI_SPSkillMenu_SkillEvent

/*=================UI_SPSkillMenu_SkillEvent=================*/static void UI_SPSkillMenu_SkillEvent( void *ptr, int notification ) {	int		id;	int		skill;	if (notification != QM_ACTIVATED)		return;	SetSkillColor( (int)trap_Cvar_VariableValue( "g_spSkill" ), text_big_color );	id = ((menucommon_s*)ptr)->id;	skill = id - ID_BABY + 1;	trap_Cvar_SetValue( "g_spSkill", skill );#ifdef TURTLEARENA	SetSkillColor( skill, color_orange );#else	SetSkillColor( skill, color_white );#endif#ifndef TA_MISC // SRB2_SKILLS	skillMenuInfo.art_skillPic.shader = skillMenuInfo.skillpics[skill - 1];	if( id == ID_NIGHTMARE ) {		trap_S_StartLocalSound( skillMenuInfo.nightmareSound, CHAN_ANNOUNCER );	}	else {		trap_S_StartLocalSound( skillMenuInfo.silenceSound, CHAN_ANNOUNCER );	}#endif}
开发者ID:Extraordinary-Beat-X,项目名称:ebx-code,代码行数:34,


示例10: UI_SPSkillMenu_SkillEvent

/*=================UI_SPSkillMenu_SkillEvent=================*/static void UI_SPSkillMenu_SkillEvent(void *ptr, int notification){	int		id;	int		skill;	if (notification != QM_ACTIVATED)		return;	SetSkillColor((int)trap_Cvar_VariableValue("g_spSkill"), color_red);	id = ((menucommon_s*)ptr)->id;	skill = id - ID_BABY + 1;	trap_Cvar_SetValue("g_spSkill", skill);	SetSkillColor(skill, color_white);	skillMenuInfo.art_skillPic.shader = skillMenuInfo.skillpics[skill - 1];	if (id == ID_NIGHTMARE)	{		trap_S_StartLocalSound(skillMenuInfo.nightmareSound, CHAN_ANNOUNCER);	}	else	{		trap_S_StartLocalSound(skillMenuInfo.silenceSound, CHAN_ANNOUNCER);	}}
开发者ID:ElderPlayerX,项目名称:Invasion,代码行数:31,


示例11: M_TV_UpdateScrollbar

//==================//M_TV_UpdateScrollbar//==================static void M_TV_UpdateScrollbar( menucommon_t *menuitem ){	menuitem->maxvalue = max( 0, channelsScrollList.numItems - max_menu_channels );	if( menuitem->curvalue > menuitem->maxvalue )  //if filters shrunk the list size, shrink the scrollbar and its value		menuitem->curvalue = menuitem->maxvalue;	trap_Cvar_SetValue( menuitem->title, menuitem->curvalue );	scrollbar_curvalue = menuitem->curvalue;}
开发者ID:Racenet,项目名称:racesow,代码行数:11,


示例12: UI_SPLevelMenu_ResetAction

static void UI_SPLevelMenu_ResetAction( qboolean result ) {	if( !result ) {		return;	}	// clear game variables	UI_NewGame();	if ( UI_GetSpecialArenaInfo( "training" ) ) {		trap_Cvar_SetValue( "ui_spSelection", -4 );	} else {		trap_Cvar_SetValue( "ui_spSelection", 0 );	}	// make the level select menu re-initialize	UI_PopMenu();	UI_SPLevelMenu();}
开发者ID:d00man,项目名称:openarena-vm,代码行数:17,


示例13: SP_worldspawn

/*QUAKED worldspawn (0 0 0) ?Every map should have exactly one worldspawn."music"		music wav file"gravity"	800 is default gravity"message"	Text to print during connection process*/void SP_worldspawn( void ) {	char	*s;	G_SpawnString( "classname", "", &s );	if ( Q_stricmp( s, "worldspawn" ) ) {		G_Error( "SP_worldspawn: The first entity isn't 'worldspawn'" );	}	// make some data visible to connecting client	trap_SetConfigstring( CS_GAME_VERSION, GAME_VERSION );	trap_SetConfigstring( CS_LEVEL_START_TIME, va("%i", level.startTime ) );	G_SpawnString( "music", "", &s );	trap_SetConfigstring( CS_MUSIC, s );	G_SpawnString( "message", "", &s );	trap_SetConfigstring( CS_MESSAGE, s );				// map specific message	trap_SetConfigstring( CS_MOTD, g_motd.string );		// message of the day	G_SpawnString( "gravity", "800", &s );	trap_Cvar_Set( "g_gravity", s );	G_SpawnString( "enableDust", "0", &s );	trap_Cvar_Set( "g_enableDust", s );	G_SpawnString( "enableBreath", "0", &s );	trap_Cvar_Set( "g_enableBreath", s );#if 0 // ZTM: Currently game doesn't need the tracemap	level.mapcoordsValid = qfalse;	if ( G_SpawnVector2D( "mapcoordsmins", "-128 128", level.mapcoordsMins ) &&  // top left		 G_SpawnVector2D( "mapcoordsmaxs", "128 -128", level.mapcoordsMaxs ) ) { // bottom right		level.mapcoordsValid = qtrue;	}#endif	g_entities[ENTITYNUM_WORLD].s.number = ENTITYNUM_WORLD;	g_entities[ENTITYNUM_WORLD].r.ownerNum = ENTITYNUM_NONE;	g_entities[ENTITYNUM_WORLD].classname = "worldspawn";	g_entities[ENTITYNUM_NONE].s.number = ENTITYNUM_NONE;	g_entities[ENTITYNUM_NONE].r.ownerNum = ENTITYNUM_NONE;	g_entities[ENTITYNUM_NONE].classname = "nothing";	// see if we want a warmup time	trap_SetConfigstring( CS_WARMUP, "" );	if ( g_restarted.integer ) {		trap_Cvar_SetValue( "g_restarted", 0 );		level.warmupTime = 0;	} else if ( g_doWarmup.integer ) { // Turn it on		level.warmupTime = -1;		trap_SetConfigstring( CS_WARMUP, va("%i", level.warmupTime) );		G_LogPrintf( "Warmup:/n" );	}}
开发者ID:SilverlineDev,项目名称:mint-arena,代码行数:65,


示例14: CG_GamepadFrame

/** * Updates time-dependent gamepad state. * * @param frametime real frame time */static void CG_GamepadFrame( float frametime ){	// Add acceleration to the gamepad look above the acceleration threshold.	vec4_t sticks;	trap_IN_GetThumbsticks( sticks );	int axes = ( cg_gamepad_swapSticks->integer ? 0 : 2 );	if( cg_gamepad_accelMax->value < 0.0f )		trap_Cvar_SetValue( cg_gamepad_accelMax->name, 0.0f );	if( cg_gamepad_accelSpeed->value < 0.0f )		trap_Cvar_SetValue( cg_gamepad_accelSpeed->name, 0.0f );	float accelMax = cg_gamepad_accelMax->value + 1.0f;	float accelSpeed = cg_gamepad_accelSpeed->value;	float accelThres = cg_gamepad_accelThres->value;	float value = fabs( sticks[axes] );	if( value > cg_gamepad_yawThres->value )	{		cg_gamepad_accelYaw += ( ( value > accelThres ) ? 1.0f : -1.0f ) * frametime * accelSpeed;		clamp( cg_gamepad_accelYaw, 1.0f, accelMax );	}	else	{		cg_gamepad_accelYaw = 1.0f;	}	value = fabs( sticks[axes + 1] );	if( value > cg_gamepad_pitchThres->value )	{		cg_gamepad_accelPitch += ( ( value > accelThres ) ? 1.0f : -1.0f ) * frametime * accelSpeed;		clamp( cg_gamepad_accelPitch, 1.0f, accelMax );	}	else	{		cg_gamepad_accelPitch = 1.0f;	}}
开发者ID:MGXRace,项目名称:racesow,代码行数:45,


示例15: PlayerSettings_SaveChanges

/*=================PlayerSettings_SaveChanges=================*/static void PlayerSettings_SaveChanges( void ) {	// name	trap_Cvar_Set( "name", s_playersettings.name.field.buffer );	// handicap	trap_Cvar_SetValue( "handicap", 100 - s_playersettings.handicap.curvalue * 5 );	// effects color	// CORKSCREW 3 effect colors	//trap_Cvar_SetValue( "color", uitogamecode[s_playersettings.effects.curvalue] );// 1.29 fix: color -> color1	trap_Cvar_Set( "color1", va( "%i %i %i", uitogamecode[s_playersettings.effects.curvalue], uitogamecode[s_playersettings.effects2.curvalue], uitogamecode[s_playersettings.effects3.curvalue] ) );}
开发者ID:linux26,项目名称:corkscrew,代码行数:18,


示例16: UI_SPLevelMenu_ResetAction

static void UI_SPLevelMenu_ResetAction( qboolean result ) {	if( !result ) {		return;	}	// clear game variables	UI_NewGame();	trap_Cvar_SetValue( "ui_spSelection", -4 );	// make the level select menu re-initialize	UI_PopMenu();	UI_SPLevelMenu();}
开发者ID:ElderPlayerX,项目名称:Rune,代码行数:13,


示例17: SoundQualityAction

static void SoundQualityAction( qboolean result ) {	if ( result ) 	{		soundOptionsInfo.holdSoundQuality = soundOptionsInfo.quality.curvalue; 		if( soundOptionsInfo.quality.curvalue ) 		{			trap_Cvar_SetValue( "s_khz", 22 );//			trap_Cvar_SetValue( "s_compression", 0 );		}		else 		{			trap_Cvar_SetValue( "s_khz", 11 );//			trap_Cvar_SetValue( "s_compression", 1 );		}		//UI_ForceMenuOff();		trap_Cmd_ExecuteText( EXEC_APPEND, "snd_restart/n" );	}	else	{		soundOptionsInfo.quality.curvalue =	soundOptionsInfo.holdSoundQuality; 	}}
开发者ID:gitter-badger,项目名称:rpgxEF,代码行数:23,


示例18: UI_DisplayOptionsMenu_Event

/*=================UI_DisplayOptionsMenu_Event=================*/static void UI_DisplayOptionsMenu_Event( void* ptr, int event ) {	if( event != QM_ACTIVATED ) {		return;	}	switch( ((menucommon_s*)ptr)->id ) {	case ID_GRAPHICS:		UI_PopMenu();		UI_GraphicsOptionsMenu();		break;	case ID_DISPLAY:		break;	case ID_SOUND:		UI_PopMenu();		UI_SoundOptionsMenu();		break;	case ID_NETWORK:		UI_PopMenu();		UI_NetworkOptionsMenu();		break;	case ID_BRIGHTNESS:		trap_Cvar_SetValue( "r_gamma", displayOptionsInfo.brightness.curvalue / 10.0f );		break;		case ID_SCREENSIZE:		trap_Cvar_SetValue( "cg_viewsize", displayOptionsInfo.screensize.curvalue * 10 );		break;	case ID_BACK:		UI_PopMenu();		break;	}}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:42,


示例19: UI_SPLevelMenu_LevelEvent

/*=================UI_SPLevelMenu_LevelEvent=================*/static void UI_SPLevelMenu_LevelEvent( void* ptr, int notification ) {	if (notification != QM_ACTIVATED) {		return;	}	if ( selectedArenaSet == trainingTier || selectedArenaSet == finalTier ) {		return;	}	selectedArena = ((menucommon_s*)ptr)->id - ID_PICTURE0;	levelMenuInfo.selectedArenaInfo = UI_GetArenaInfoByNumber( selectedArenaSet * ARENAS_PER_TIER + selectedArena );	UI_SPLevelMenu_SetBots();	trap_Cvar_SetValue( "ui_spSelection", selectedArenaSet * ARENAS_PER_TIER + selectedArena );}
开发者ID:ElderPlayerX,项目名称:Rune,代码行数:20,


示例20: UI_SoundOptionsMenu_Event

/*=================UI_SoundOptionsMenu_Event================= */static void UI_SoundOptionsMenu_Event(void* ptr, int event) {    if (event != QM_ACTIVATED) {        return;    }    switch (((menucommon_s*) ptr)->id) {        case ID_GRAPHICS:            UI_PopMenu();            UI_GraphicsOptionsMenu();            break;        case ID_DISPLAY:            UI_PopMenu();            UI_DisplayOptionsMenu();            break;        case ID_SOUND:            break;        case ID_EFFECTSVOLUME:            trap_Cvar_SetValue("s_volume", soundOptionsInfo.sfxvolume.curvalue / 10);            break;        case ID_MUSICVOLUME:            trap_Cvar_SetValue("s_musicvolume", soundOptionsInfo.musicvolume.curvalue / 10);            break;        case ID_QUALITY:            if (soundOptionsInfo.quality.curvalue) {                trap_Cvar_SetValue("s_khz", 22);                trap_Cvar_SetValue("s_compression", 0);            } else {                trap_Cvar_SetValue("s_khz", 11);                trap_Cvar_SetValue("s_compression", 1);            }            UI_ForceMenuOff();            trap_Cmd_ExecuteText(EXEC_APPEND, "snd_restart/n");            break;            /*                    case ID_A3D:                            if( soundOptionsInfo.a3d.curvalue ) {                                    trap_Cmd_ExecuteText( EXEC_NOW, "s_enable_a3d/n" );                            }                            else {                                    trap_Cmd_ExecuteText( EXEC_NOW, "s_disable_a3d/n" );                            }                            soundOptionsInfo.a3d.curvalue = (int)trap_Cvar_VariableValue( "s_usingA3D" );                            break;             */        case ID_BACK:            UI_PopMenu();            break;    }}
开发者ID:zturtleman,项目名称:q3rain,代码行数:59,


示例21: Reset_MenuEvent

/*=================Reset_MenuEvent=================*/void Reset_MenuEvent(void* ptr, int event) {	if( event != QM_ACTIVATED ) {		return;	}	UI_PopMenu();	if( ((menucommon_s*)ptr)->id == ID_NO ) {		return;	}	// reset the game, pop the level menu and restart it so it updates	UI_NewGame();	trap_Cvar_SetValue( "ui_spSelection", 0 );	UI_PopMenu();	UI_SPLevelMenu();}
开发者ID:OpenArena,项目名称:gamecode,代码行数:22,


示例22: StartServer_UpdateOrderMethod

static void StartServer_UpdateOrderMethod( menucommon_t *menuitem ){    char mapinfo[MAX_CONFIGSTRING_CHARS] = { 0 };    m_listitem_t *mapitem;    trap_Cvar_SetValue( "ui_maplist_sortmethod", menuitem->curvalue );    mapitem = UI_FindItemInScrollListWithId( &mapList, mapList_cur_idx );    if( mapitem && mapitem->name )        trap_ML_GetMapByNum( (int)((size_t)mapitem->data), mapinfo, sizeof( mapinfo ) );    MapsList_CreateItems( mapinfo );    MapsList_ChooseMap( NULL );    menuitem = UI_MenuItemByName( "m_mapList_scrollbar" );    menuitem->curvalue = bound( menuitem->minvalue, mapList_cur_idx, menuitem->maxvalue );    MapsList_UpdateScrollbar( menuitem );}
开发者ID:Racenet,项目名称:racesow,代码行数:18,


示例23: Controls_InitCvars

/*=================Controls_InitCvars=================*/static void Controls_InitCvars( void ){	int				i;	configcvar_t*	cvarptr;	cvarptr = g_configcvars;	for (i=0; ;i++,cvarptr++)	{		if (!cvarptr->name)			break;		// get current value		cvarptr->value = trap_Cvar_VariableValue( cvarptr->name );		// get default value		trap_Cvar_Reset( cvarptr->name );		cvarptr->defaultvalue = trap_Cvar_VariableValue( cvarptr->name );		// restore current value		trap_Cvar_SetValue( cvarptr->name, cvarptr->value );	}}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:27,


示例24: abs

static c4clipedict_t *GClip_GetClipEdictForDeltaTime( int entNum, int deltaTime ){	static int index = 0;	static c4clipedict_t clipEnts[8];	static c4clipedict_t *clipent;	static c4clipedict_t clipentNewer; // for interpolation	c4frame_t *cframe = NULL;	unsigned int backTime, cframenum, backframes, i;	edict_t	*ent = game.edicts + entNum;	// pick one of the 8 slots to prevent overwritings	clipent = &clipEnts[index];	index = ( index + 1 )&7;	if( !entNum || deltaTime >= 0 || !g_antilag->integer )	{                                                    // current time entity		clipent->r = ent->r;		clipent->s = ent->s;		return clipent;	}	if( !ent->r.inuse || ent->r.solid == SOLID_NOT 		|| ( ent->r.solid == SOLID_TRIGGER && !(entNum >= 1 && entNum <= gs.maxclients) ) )	{		clipent->r = ent->r;		clipent->s = ent->s;		return clipent;	}	// clamp delta time inside the backed up limits	backTime = abs( deltaTime );	if( g_antilag_maxtimedelta->integer )	{		if( g_antilag_maxtimedelta->integer < 0 )			trap_Cvar_SetValue( "g_antilag_maxtimedelta", abs( g_antilag_maxtimedelta->integer ) );		if( backTime > (unsigned int)g_antilag_maxtimedelta->integer )			backTime = (unsigned int)g_antilag_maxtimedelta->integer;	}	// find the first snap with timestamp < than realtime - backtime	cframenum = sv_collisionFrameNum;	for( backframes = 1; backframes < CFRAME_UPDATE_BACKUP && backframes < sv_collisionFrameNum; backframes++ ) // never overpass limits	{		cframe = &sv_collisionframes[( cframenum-backframes ) & CFRAME_UPDATE_MASK];		// if solid has changed, we can't keep moving backwards		if( ent->r.solid != cframe->clipEdicts[entNum].r.solid || ent->r.inuse != cframe->clipEdicts[entNum].r.inuse )		{			backframes--;			if( backframes == 0 )			{           // we can't step back from first				cframe = NULL;			}			else			{				cframe = &sv_collisionframes[( cframenum-backframes ) & CFRAME_UPDATE_MASK];			}			break;		}		if( game.serverTime >= cframe->timestamp + backTime )			break;	}	if( !cframe )	{           // current time entity		clipent->r = ent->r;		clipent->s = ent->s;		return clipent;	}	// setup with older for the data that is not interpolated	*clipent = cframe->clipEdicts[entNum];	// if we found an older than desired backtime frame, interpolate to find a more precise position.	if( game.serverTime > cframe->timestamp+backTime )	{		float lerpFrac;		if( backframes == 1 )		{               // interpolate from 1st backed up to current			lerpFrac = (float)( ( game.serverTime - backTime ) - cframe->timestamp ) / (float)( game.serverTime - cframe->timestamp );			clipentNewer.r = ent->r;			clipentNewer.s = ent->s;		}		else		{ // interpolate between 2 backed up			c4frame_t *cframeNewer = &sv_collisionframes[( cframenum-( backframes-1 ) ) & CFRAME_UPDATE_MASK];			lerpFrac = (float)( ( game.serverTime - backTime ) - cframe->timestamp ) / (float)( cframeNewer->timestamp - cframe->timestamp );			clipentNewer = cframeNewer->clipEdicts[entNum];		}		//G_Printf( "backTime:%i cframeBackTime:%i backFrames:%i lerfrac:%f/n", backTime, game.serverTime - cframe->timestamp, backframes, lerpFrac );		// interpolate		VectorLerp( clipent->s.origin, lerpFrac, clipentNewer.s.origin, clipent->s.origin );		VectorLerp( clipent->r.mins, lerpFrac, clipentNewer.r.mins, clipent->r.mins );		VectorLerp( clipent->r.maxs, lerpFrac, clipentNewer.r.maxs, clipent->r.maxs );		for( i = 0; i < 3; i++ )			clipent->s.angles[i] = LerpAngle( clipent->s.angles[i], clipentNewer.s.angles[i], lerpFrac );	}//.........这里部分代码省略.........
开发者ID:Kaperstone,项目名称:warsow,代码行数:101,



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


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