• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ CVAR_GET_FLOAT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Draw

int CHudStatusBar :: Draw( float fTime )
{
 
	this->ReparseStringIfNeeded();

	// Draw the status bar lines
	for ( int i = 0; i < MAX_STATUSBAR_LINES; i++ )
	{
		int TextHeight, TextWidth;
		GetConsoleStringSize( m_szStatusBar[i], &TextWidth, &TextHeight );

		int Y_START;
		if ( ScreenHeight() >= 480 )
			Y_START = ScreenHeight() - 55;
		else
			Y_START = ScreenHeight() - 45;

		int x = 5;
		int y = Y_START - ( TextHeight * i ); // draw along bottom of screen

		// let user set status ID bar centering
		if ( (i == STATUSBAR_ID_LINE) && CVAR_GET_FLOAT("hud_centerid") )
		{
			x = max( 0, max(2, (ScreenWidth() - TextWidth)) / 2 );
			y = (ScreenHeight() / 2) + (TextHeight*CVAR_GET_FLOAT("hud_centerid"));
		}

		if ( m_pflNameColors[i] )
			DrawSetTextColor( m_pflNameColors[i][0], m_pflNameColors[i][1], m_pflNameColors[i][2] );

		DrawConsoleString( x, y, m_szStatusBar[i] );
	}

	return 1;
}
开发者ID:Arkshine,项目名称:NS,代码行数:35,代码来源:statusbar.cpp


示例2: UI_CreateGame_Begin

/*
=================
UI_CreateGame_Begin
=================
*/
static void UI_CreateGame_Begin( void )
{
	if( !MAP_IS_VALID( uiCreateGame.mapName[uiCreateGame.mapsList.curItem] ))
		return;	// bad map

	if( CVAR_GET_FLOAT( "host_serverstate" ) && CVAR_GET_FLOAT( "maxplayers" ) == 1 )
		HOST_ENDGAME( "end of the game" );

	CVAR_SET_FLOAT( "deathmatch", 1.0f );	// FIXME
	CVAR_SET_FLOAT( "maxplayers", atoi( uiCreateGame.maxClients.buffer ));
	CVAR_SET_STRING( "hostname", uiCreateGame.hostName.buffer );
	CVAR_SET_STRING( "defaultmap", uiCreateGame.mapName[uiCreateGame.mapsList.curItem] );

	// all done, start server
	if( uiCreateGame.dedicatedServer.enabled )
	{
		HOST_WRITECONFIG ( CVAR_GET_STRING( "servercfgfile" ));

		char cmd[128];
		sprintf( cmd, "#%s", gMenu.m_gameinfo.gamefolder );

		// NOTE: dedicated server will be executed "defaultmap"
		// from engine after restarting
		HOST_CHANGEGAME( cmd, "Starting dedicated server...\n" );
	}
	else
	{
		HOST_WRITECONFIG ( CVAR_GET_STRING( "lservercfgfile" ));

		char cmd[128];
		sprintf( cmd, "exec %s\nmap %s\n", CVAR_GET_STRING( "lservercfgfile" ), CVAR_GET_STRING( "defaultmap" ));
	
		CLIENT_COMMAND( FALSE, cmd );
	}
}
开发者ID:bmk10,项目名称:sing-engine,代码行数:40,代码来源:menu_creategame.cpp


示例3: UI_PlayerSetup_GetConfig

/*
=================
UI_PlayerSetup_GetConfig
=================
*/
static void UI_PlayerSetup_GetConfig( void )
{
	int	i;

	strncpy( uiPlayerSetup.name.buffer, CVAR_GET_STRING( "name" ), sizeof( uiPlayerSetup.name.buffer ));

	// find models
	UI_PlayerSetup_FindModels();

	// select current model
	for( i = 0; i < uiPlayerSetup.num_models; i++ )
	{
		if( !stricmp( uiPlayerSetup.models[i], CVAR_GET_STRING( "model" )))
		{
			uiPlayerSetup.model.curValue = (float)i;
			break;
		}
	}

	if( gMenu.m_gameinfo.flags & GFL_NOMODELS )
		uiPlayerSetup.model.curValue = 0.0f; // force to default

	strcpy( uiPlayerSetup.currentModel, uiPlayerSetup.models[(int)uiPlayerSetup.model.curValue] );
	uiPlayerSetup.model.maxValue = (float)(uiPlayerSetup.num_models - 1);

	uiPlayerSetup.topColor.curValue = CVAR_GET_FLOAT( "topcolor" ) / 255;
	uiPlayerSetup.bottomColor.curValue = CVAR_GET_FLOAT( "bottomcolor" ) / 255;

	if( CVAR_GET_FLOAT( "cl_himodels" ))
		uiPlayerSetup.hiModels.enabled = 1;

	if( CVAR_GET_FLOAT( "ui_showmodels" ))
		uiPlayerSetup.showModels.enabled = 1;
}
开发者ID:Rhoin,项目名称:Xash3D-CrossPlatform-Port,代码行数:39,代码来源:menu_playersetup.cpp


示例4: UI_PromptDialog

static void UI_PromptDialog( void )
{
	if( !CVAR_GET_FLOAT( "host_serverstate" ) || CVAR_GET_FLOAT( "sv_background" ))
	{
		UI_CreateGame_Begin();
		return;
	}
	
	// toggle main menu between active\inactive
	// show\hide quit dialog
	uiCreateGame.advOptions.generic.flags ^= QMF_INACTIVE; 
	uiCreateGame.done.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.cancel.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.maxClients.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.hostName.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.password.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.dedicatedServer.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.hltv.generic.flags ^= QMF_INACTIVE;
	uiCreateGame.mapsList.generic.flags ^= QMF_INACTIVE;

	uiCreateGame.msgBox.generic.flags ^= QMF_HIDDEN;
	uiCreateGame.dlgMessage1.generic.flags ^= QMF_HIDDEN;
	uiCreateGame.dlgMessage2.generic.flags ^= QMF_HIDDEN;
	uiCreateGame.no.generic.flags ^= QMF_HIDDEN;
	uiCreateGame.yes.generic.flags ^= QMF_HIDDEN;

}
开发者ID:Xash3DLinux,项目名称:xash3dlinux,代码行数:27,代码来源:menu_creategame.cpp


示例5: BEGIN_READ

int CHud::MsgFunc_SetFOV(const char *pszName,  int iSize, void *pbuf)
{
	BEGIN_READ( pbuf, iSize );

	int newfov = READ_BYTE();
	int def_fov = CVAR_GET_FLOAT( "default_fov" );

	if ( newfov == 0 )
	{
		m_iFOV = def_fov;
	}
	else
	{
		m_iFOV = newfov;
	}

	// the clients fov is actually set in the client data update section of the hud

	// Set a new sensitivity
	if ( m_iFOV == def_fov )
	{  
		// reset to saved sensitivity
		m_flMouseSensitivity = 0;
	}
	else
	{  
		// set a new sensitivity that is proportional to the change from the FOV default
		m_flMouseSensitivity = sensitivity->value * ((float)newfov / (float)def_fov) * CVAR_GET_FLOAT("zoom_sensitivity_ratio");
	}

	return 1;
}
开发者ID:NoFreeWill,项目名称:MultiplayerSource,代码行数:32,代码来源:hud.cpp


示例6: UI_GamePad_GetConfig

/*
=================
UI_GamePad_GetConfig
=================
*/
static void UI_GamePad_GetConfig( void )
{
	float side, forward, pitch, yaw;
	char binding[7] = { 0 };
	static char lt_threshold_text[8], rt_threshold_text[8];

	strncpy( binding, CVAR_GET_STRING( "joy_axis_binding"), sizeof( binding ));

	side = CVAR_GET_FLOAT( "joy_side" );
	forward = CVAR_GET_FLOAT( "joy_forward" );
	pitch = CVAR_GET_FLOAT( "joy_pitch" );
	yaw = CVAR_GET_FLOAT( "joy_yaw" );

	uiGamePad.side.curValue = fabs( side );
	uiGamePad.forward.curValue = fabs( forward );
	uiGamePad.pitch.curValue = fabs( pitch );
	uiGamePad.yaw.curValue = fabs( yaw );

	uiGamePad.invSide.enabled = side < 0.0f ? true: false;
	uiGamePad.invFwd.enabled = forward < 0.0f ? true: false;
	uiGamePad.invPitch.enabled = pitch < 0.0f ? true: false;
	uiGamePad.invYaw.enabled = yaw < 0.0f ? true: false;

	// I made a monster...
	for( int i = 0; i < sizeof( binding ) - 1; i++ )
	{
		switch( binding[i] )
		{
		case 's':
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_SIDE];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_SIDE;
			break;
		case 'f':
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_FWD];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_FWD;
			break;
		case 'p':
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_PITCH];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_PITCH;
			break;
		case 'y':
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_YAW];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_YAW;
			break;
		case 'r':
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_RT];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_RT;
			break;
		case 'l':
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_LT];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_LT;
			break;
		default:
			uiGamePad.axisBind[i].generic.name = axisNames[JOY_AXIS_NULL];
			uiGamePad.axisBind[i].curValue = JOY_AXIS_NULL;
		}
	}
}
开发者ID:Reedych,项目名称:xash3d,代码行数:63,代码来源:menu_gamepad.cpp


示例7: VARS

void CBlackHole::RadiusDamage( )
{
	CBaseEntity *pEntity = NULL;
	TraceResult	tr;
	float		flAdjustedDamage;
	Vector		vecSpot;

	entvars_t *pevOwner = VARS( pev->owner );
	Vector vecSrc = pev->origin + Vector(0,0,1);

	if ( !pevOwner )
		pevOwner = pev;

	CBaseEntity *pPlayer = CBaseEntity::Instance (pevOwner);

	// iterate on all entities in the vicinity.
	while ((pEntity = UTIL_FindEntityInSphere( pEntity, vecSrc, (dmg_chrono_radius.value * (mp_wpn_power.value/100)) )) != NULL)
	{
		if ( pEntity->pev->movetype != MOVETYPE_PUSH && pEntity->pev->movetype != MOVETYPE_NONE && pEntity->pev->movetype != MOVETYPE_FOLLOW && pEntity->pev->movetype != MOVETYPE_NOCLIP )
		{
			if (pEntity == this) continue;

			if (CVAR_GET_FLOAT("mp_noselfdamage")==1 && pEntity->pev == pevOwner )
			continue;

			if (CVAR_GET_FLOAT("mp_noteamdamage")==1 && g_pGameRules->PlayerRelationship(pPlayer, pEntity) == GR_TEAMMATE && pEntity->pev != pevOwner)
			continue;

			vecSpot = pEntity->BodyTarget( vecSrc );
			
			UTIL_TraceLine ( vecSrc, vecSpot, ignore_monsters, ENT(pev), &tr );

			if ( tr.flFraction == 1.0 || tr.pHit == pEntity->edict() )
			{
				flAdjustedDamage = ( vecSrc - tr.vecEndPos ).Length();
			
				if ( flAdjustedDamage <	1 )
					flAdjustedDamage = 1;
			
				Vector m_vel = ( vecSrc - tr.vecEndPos ).Normalize() * ((500 * (dmg_chrono_radius.value * (mp_wpn_power.value/100)) / flAdjustedDamage) + 150);

				if (m_vel.Length() > 1000) m_vel = m_vel.Normalize() * 1000;

				pEntity->pev->velocity = m_vel;

				if (flAdjustedDamage < 200)
				{
					if (!(pEntity->Classify() == CLASS_MACHINE || pEntity->IsBot() || pEntity->IsPlayer() || FClassnameIs(pEntity->pev, "laser_dot") || FClassnameIs(pEntity->pev, "laser_spot")))
					{
						pEntity->Killed ( pevOwner, 0 );
						return;
					}
				}
				
			}
		}
	}
}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:58,代码来源:proj_blackhole.cpp


示例8: StartFrame

//
// GLOBALS ASSUMED SET:  g_ulFrameCount
//
void StartFrame( void )
{
	if ( g_pGameRules )
		g_pGameRules->Think();

	if ( g_fGameOver )
		return;

	gpGlobals->teamplay = CVAR_GET_FLOAT("teamplay");
	g_iSkillLevel = CVAR_GET_FLOAT("skill");
	g_ulFrameCount++;
}
开发者ID:devkin021,项目名称:ricochet,代码行数:15,代码来源:client.cpp


示例9: UI_VidOptions_GetConfig

/*
=================
UI_VidOptions_GetConfig
=================
*/
static void UI_VidOptions_GetConfig( void )
{
	uiVidOptions.screenSize.curValue = (CVAR_GET_FLOAT( "viewsize" ) - 20.0f ) / 100.0f;
	uiVidOptions.gammaIntensity.curValue = (CVAR_GET_FLOAT( "vid_gamma" ) - 0.5f) / 1.8f;
	uiVidOptions.glareReduction.curValue = (CVAR_GET_FLOAT( "r_flaresize" ) - 100.0f ) / 200.0f;

	if( CVAR_GET_FLOAT( "r_fastsky" ))
		uiVidOptions.fastSky.enabled = 1;

	uiVidOptions.outlineWidth = 2;
	UI_ScaleCoords( NULL, NULL, &uiVidOptions.outlineWidth, NULL );
}
开发者ID:bmk10,项目名称:sing-engine,代码行数:17,代码来源:menu_vidoptions.cpp


示例10: UI_NewGame_StartGame

/*
=================
UI_NewGame_StartGame
=================
*/
static void UI_NewGame_StartGame( float skill )
{
	if( CVAR_GET_FLOAT( "host_serverstate" ) && CVAR_GET_FLOAT( "maxplayers" ) > 1 )
		HOST_ENDGAME( "end of the game" );

	CVAR_SET_FLOAT( "skill", skill );
	CVAR_SET_FLOAT( "deathmatch", 0.0f );
	CVAR_SET_FLOAT( "teamplay", 0.0f );
	CVAR_SET_FLOAT( "pausable", 1.0f ); // singleplayer is always allowing pause
	CVAR_SET_FLOAT( "maxplayers", 1.0f );
	CVAR_SET_FLOAT( "coop", 0.0f );

	CLIENT_COMMAND( FALSE, "newgame\n" );
}
开发者ID:Rhoin,项目名称:Xash3D-CrossPlatform-Port,代码行数:19,代码来源:menu_newgame.cpp


示例11: GibMonster

//=========================================================
// GibMonster - create some gore and get rid of a monster's
// model.
//=========================================================
void CBaseMonster :: GibMonster( void )
{
	TraceResult	tr;
	BOOL		gibbed = FALSE;
	int			iszCustomGibs;

	EMIT_SOUND(ENT(pev), CHAN_WEAPON, "common/bodysplat.wav", 1, ATTN_NORM);		

	if ( iszCustomGibs = HasCustomGibs() ) //LRC - monster_generic can have a custom gibset
	{
		if ( CVAR_GET_FLOAT("violence_hgibs") != 0 )
		{
			CGib::SpawnHeadGib( pev, STRING(iszCustomGibs) );
			CGib::SpawnRandomGibs( pev, 4, 1, STRING(iszCustomGibs) );
		}
		gibbed = TRUE;
	}
	// only humans throw skulls !!!UNDONE - eventually monsters will have their own sets of gibs
	else if ( HasHumanGibs() )
	{
		if ( CVAR_GET_FLOAT("violence_hgibs") != 0 )// Only the player will ever fail this test
		{
			CGib::SpawnHeadGib( pev );
			CGib::SpawnRandomGibs( pev, 4, 1 );	// throw some human gibs.
		}
		gibbed = TRUE;
	}
	else if ( HasAlienGibs() )
	{
		if ( CVAR_GET_FLOAT("violence_agibs") != 0 )// Should never fail this test, but someone might call it directly
		{
			CGib::SpawnRandomGibs( pev, 4, 0 );	// Throw alien gibs
		}
		gibbed = TRUE;
	}

	if ( !IsPlayer() )
	{
		if ( gibbed )
		{
			// don't remove players!
			SetThink(&CBaseMonster :: SUB_Remove );
			SetNextThink( 0 );
		}
		else
		{
			FadeMonster();
		}
	}
}
开发者ID:RichardRohac,项目名称:hl-amnesia-src,代码行数:54,代码来源:combat.cpp


示例12: UI_GameOptions_GetConfig

/*
=================
UI_GameOptions_GetConfig
=================
*/
static void UI_GameOptions_GetConfig( void )
{
	uiGameInitial.maxFPS = uiGameOptions.maxFPS.curValue = CVAR_GET_FLOAT( "fps_max" );

	if( CVAR_GET_FLOAT( "hand" ))
		uiGameInitial.hand = uiGameOptions.hand.enabled = 1;

	if( CVAR_GET_FLOAT( "cl_run" ))
		uiGameInitial.alwaysRun = uiGameOptions.alwaysRun.enabled = 1;

	if( CVAR_GET_FLOAT( "sv_allow_download" ))
		uiGameInitial.allowDownload = uiGameOptions.allowDownload.enabled = 1;

	UI_GameOptions_UpdateConfig ();
}
开发者ID:mittorn,项目名称:xash3d,代码行数:20,代码来源:menu_gameoptions.cpp


示例13: UI_Main_NewGame

/*
=================
UI_Main_NewGame
=================
*/
static void UI_Main_NewGame( void )
{
	if( CVAR_GET_FLOAT( "host_serverstate" ) && CVAR_GET_FLOAT( "maxplayers" ) > 1 )
		HOST_ENDGAME( "end of the game" );

	CVAR_SET_FLOAT( "skill", 1.0f );
	CVAR_SET_FLOAT( "deathmatch", 0.0f );
	CVAR_SET_FLOAT( "teamplay", 0.0f );
	CVAR_SET_FLOAT( "pausable", 1.0f ); // singleplayer is always allowing pause
	CVAR_SET_FLOAT( "coop", 0.0f );

	BACKGROUND_TRACK( NULL, NULL );

	CLIENT_COMMAND( FALSE, "newgame\n" );
}
开发者ID:EverydayGeek,项目名称:QuakeRemakeDevkit,代码行数:20,代码来源:menu_main.cpp


示例14: CanHavePlayerItem

//=========================================================
// CanHaveWeapon - returns FALSE if the player is not allowed
// to pick up this weapon
//=========================================================
BOOL CHalfLifeMultiplay::CanHavePlayerItem( CBasePlayer *pPlayer, CBasePlayerItem *pItem )
{
	if ( CVAR_GET_FLOAT("mp_weaponstay") > 0 )
	{
		if ( pItem->iFlags() & ITEM_FLAG_LIMITINWORLD )
			return CGameRules::CanHavePlayerItem( pPlayer, pItem );

		// check if the player already has this weapon
		for ( int i = 0 ; i < MAX_ITEM_TYPES ; i++ )
		{
			CBasePlayerItem *it = pPlayer->m_rgpPlayerItems[i];

			while ( it != NULL )
			{
				if ( it->m_iId == pItem->m_iId )
				{
					return FALSE;
				}

				it = it->m_pNext;
			}
		}
	}

	return CGameRules::CanHavePlayerItem( pPlayer, pItem );
}
开发者ID:jpiolho,项目名称:halflife,代码行数:30,代码来源:multiplay_gamerules.cpp


示例15: Spawn

void CFuncMonsterClip::Spawn( void )
{
	CFuncWall::Spawn();
	if ( CVAR_GET_FLOAT("showtriggers") == 0 )
		pev->effects = EF_NODRAW;
	pev->flags |= FL_MONSTERCLIP;
}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:7,代码来源:bmodels.cpp


示例16: RenderScreenGlow

void RenderScreenGlow()
{
 	if (IEngineStudio.IsHardware() != 1)
		return;

	if (CVAR_GET_FLOAT("r_glow") == 0)	 //check the cvar for the glow is on.
		return;

	if (CVAR_GET_FLOAT("r_glow") == 1){	//check the mode is shader
		RenderScreenGlowShader();	//AJH don't need r_glowmode, use r_glow 0/1/2 instead
	}

	else if (CVAR_GET_FLOAT("r_glow") == 2){ //If its not a shader its the lowend
		RenderScreenGlowLowEnd();	//AJH don't need r_glowmode, use r_glow 0/1/2 instead
	}
}
开发者ID:fmoraw,项目名称:SpiritOfHalfLife,代码行数:16,代码来源:glow.cpp


示例17: InitScreenGlow

void InitScreenGlow()
{
	if (IEngineStudio.IsHardware() != 1)
		return;

	if (CVAR_GET_FLOAT("r_glow") == 0)
		return;

	if (CVAR_GET_FLOAT("r_glow") == 1){
		InitScreenGlowShader();	//AJH don't need r_glowmode, use r_glow 0/1/2 instead

	}
	else if (CVAR_GET_FLOAT("r_glow") == 2){
		InitScreenGlowLowEnd();	//AJH don't need r_glowmode, use r_glow 0/1/2 instead
	}
}
开发者ID:fmoraw,项目名称:SpiritOfHalfLife,代码行数:16,代码来源:glow.cpp


示例18: delete

/* <1effeb> ../cstrike/dlls/career_tasks.cpp:643 */
void CCareerTaskManager::Reset(bool deleteTasks)
{
	if (deleteTasks)
	{
		for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
		{
			delete (*it);
		}

		m_tasks.clear();
		m_nextId = 0;
	}
	else
	{
		for (CareerTaskListIt it = m_tasks.begin(); it != m_tasks.end(); ++it)
		{
			CCareerTask *pTask = (*it);
			pTask->Reset();
		}
	}

	m_finishedTaskTime  = 0;
	m_finishedTaskRound = 0;
	m_shouldLatchRoundEndMessage = false;

	m_roundStartTime = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime");
}
开发者ID:Adidasman1,项目名称:ReGameDLL_CS,代码行数:28,代码来源:career_tasks.cpp


示例19: MsgFunc_MOTD

int CHudMOTD :: MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf )
{
	if( m_iFlags & HUD_ACTIVE )
	{
		Reset(); // clear the current MOTD in prep for this one
	}

	BEGIN_READ( pszName, pbuf, iSize );

	int is_finished = READ_BYTE();
	Q_strcat( m_szMOTD, READ_STRING( ));

	if( is_finished )
	{
		m_iFlags |= HUD_ACTIVE;

		MOTD_DISPLAY_TIME = CVAR_GET_FLOAT( "motd_display_time" );

		m_flActiveTill = gHUD.m_flTime + MOTD_DISPLAY_TIME;

		// count the number of lines in the MOTD
		for( char *sz = m_szMOTD; *sz != 0; sz++ )
			if( *sz == '\n' ) m_iLines++;
	}

	END_READ();

	return 1;
}
开发者ID:XashDev,项目名称:XashXT,代码行数:29,代码来源:motd.cpp


示例20: UI_Background_Ownerdraw

/*
=================
UI_Background_Ownerdraw
=================
*/
static void UI_Background_Ownerdraw( void *self )
{
	// map has background
	if( CVAR_GET_FLOAT( "cl_background" ))
		return;

	UI_DrawBackground_Callback( self );

	if (uiStatic.m_fHaveSteamBackground || uiStatic.m_fDisableLogo)
		return; // no logos for steam background

	if( GetLogoLength() <= 0.05f || GetLogoWidth() <= 32 )
		return;	// don't draw stub logo (GoldSrc rules)

	float	logoWidth, logoHeight, logoPosY;
	float	scaleX, scaleY;

	scaleX = ScreenWidth / 640.0f;
	scaleY = ScreenHeight / 480.0f;

	logoWidth = GetLogoWidth() * scaleX;
	logoHeight = GetLogoHeight() * scaleY;
	logoPosY = 70 * scaleY;	// 70 it's empirically determined value (magic number)

	DRAW_LOGO( "logo.avi", 0, logoPosY, logoWidth, logoHeight );
}
开发者ID:EverydayGeek,项目名称:QuakeRemakeDevkit,代码行数:31,代码来源:menu_main.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CVF_ASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ CVAL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap