当前位置: 首页>>代码示例>>C++>>正文


C++ ConVarRef::GetInt方法代码示例

本文整理汇总了C++中ConVarRef::GetInt方法的典型用法代码示例。如果您正苦于以下问题:C++ ConVarRef::GetInt方法的具体用法?C++ ConVarRef::GetInt怎么用?C++ ConVarRef::GetInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConVarRef的用法示例。


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

示例1: LayoffFrame

void CReplayRenderer::LayoffFrame( int nFrame )
{
	VPROF_BUDGET( "CReplayRenderer::LayoffFrame", VPROF_BUDGETGROUP_REPLAY );
	// FIXME: This is somewhat of a hack to get layoff working again
	// We're rendering into the full preview size, but stretching down to the actual size
	Rect_t srcRect;
	srcRect.x = 0;
	srcRect.y = 0;
	srcRect.width = m_RenderParams.m_Settings.m_nWidth;
	srcRect.height = m_RenderParams.m_Settings.m_nHeight;

	Rect_t dstRect;
	dstRect.x = 0;
	dstRect.y = 0;
	dstRect.width = m_RenderParams.m_Settings.m_nWidth;
	dstRect.height = m_RenderParams.m_Settings.m_nHeight;

	#ifdef TRACE_REPLAY_STATE_MACHINE
		Msg( "laying off movie frame %i\n", nFrame );
	#endif

	CMatRenderContextPtr pRenderContext( materials );
// 	pRenderContext->ReadPixelsAndStretch( &srcRect, &dstRect, (unsigned char*)m_pLayoffBuf, 
// 		IMAGE_FORMAT_BGRA8888, dstRect.width * ImageLoader::SizeInBytes( IMAGE_FORMAT_BGRA8888 ) );

	pRenderContext->ReadPixels( 0, 0, (int) m_RenderParams.m_Settings.m_nWidth, (int) m_RenderParams.m_Settings.m_nHeight, (unsigned char*)m_pLayoffBuf, IMAGE_FORMAT_BGRA8888 );

	static ConVarRef mat_queue_mode( "mat_queue_mode" );

	// Encode the frame
#ifdef REPLAY_RECORDING_ENABLE
	if ( m_RenderParams.m_bExportRaw )
	{
		CUtlBuffer bufOut;
        if ( TGAWriter::WriteToBuffer( (unsigned char *)m_pLayoffBuf, bufOut, m_RenderParams.m_Settings.m_nWidth,
			m_RenderParams.m_Settings.m_nHeight, IMAGE_FORMAT_BGRA8888, IMAGE_FORMAT_RGB888 ) )
		{
			// Format filename and write the TGA
			CFmtStr fmtFilename(
				"%sFrame_%04i.tga",
				m_fmtTgaRenderDirName.Access(),
				m_iTgaFrame++
			);

	        if ( !g_pFullFileSystem->WriteFile( fmtFilename.Access(), NULL, bufOut ) )
	        {
	            Warning( "Couldn't write bitmap data snapshot to file %s.\n", fmtFilename.Access() );
	        }
		}
	}
	else if ( m_pMovieMaker )
	{
		// can't run in any other mode	
		Assert( mat_queue_mode.GetInt() == 0 );
		VPROF_BUDGET( "CReplayRenderer::LayoffFrame - AppendVideoFrame", VPROF_BUDGETGROUP_REPLAY );
		m_pMovieMaker->AppendVideoFrame( m_pLayoffBuf );
	}
#endif
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:59,代码来源:replayrenderer.cpp

示例2: DoClick

//-----------------------------------------------------------------------------
// Purpose:	Activate a button click.
//-----------------------------------------------------------------------------
void Button::DoClick()
{
	SetSelected(true);
	FireActionSignal();
	PlayButtonReleasedSound();

	static ConVarRef vgui_nav_lock( "vgui_nav_lock" );
	if ( ( !vgui_nav_lock.IsValid() || vgui_nav_lock.GetInt() == 0 ) && NavigateActivate() )
	{
		vgui_nav_lock.SetValue( 1 );
	}

	if ( !m_bStaySelectedOnClick )
	{
		SetSelected(false);
	}
}
开发者ID:Asunaya,项目名称:game,代码行数:20,代码来源:Button.cpp

示例3: ApplySchemeSettings

void SignInDialog::ApplySchemeSettings( IScheme *pScheme )
{
	BaseClass::ApplySchemeSettings( pScheme );

#ifdef _X360
	char chGamerName[256];

	XUSER_SIGNIN_INFO xsi;
	if ( XBX_GetPrimaryUserId() >= 0 &&
		 XUserGetSigninState( XBX_GetPrimaryUserId() ) != eXUserSigninState_NotSignedIn &&
		 ERROR_SUCCESS == XUserGetName( XBX_GetPrimaryUserId(), chGamerName, sizeof( chGamerName ) ) &&
		 ERROR_SUCCESS == XUserGetSigninInfo( XBX_GetPrimaryUserId(), XUSER_GET_SIGNIN_INFO_ONLINE_XUID_ONLY, &xsi ) &&
		 !(xsi.dwInfoFlags & XUSER_INFO_FLAG_GUEST) )	// need to catch promoted-guest-accounts
	{
		static ConVarRef cl_names_debug( "cl_names_debug" );
		if ( cl_names_debug.GetInt() )
		{
			strcpy( chGamerName, PLAYER_DEBUG_NAME );
		}

		const unsigned messageLen = 256;
		wchar_t* wStringTableEntry = g_pVGuiLocalize->Find( "#L4D360UI_SignIn_Title" );

		wchar_t wWelcomeMsg[ messageLen ];
		wchar_t wGamerTag[ messageLen ];
		g_pVGuiLocalize->ConvertANSIToUnicode( chGamerName, wGamerTag, sizeof( wGamerTag ) );

		g_pVGuiLocalize->ConstructString( wWelcomeMsg, sizeof( wWelcomeMsg ), wStringTableEntry,
			1, wGamerTag );

		SetSignInTitle( wWelcomeMsg );
		m_bSignedIn = true;
	}
	else
#endif
	{
		SetSignInTitle( "#L4D360UI_SignIn_TitleNo" );
		m_bSignedIn = false;
	}
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:40,代码来源:vsignindialog.cpp

示例4: OnCompletedAsyncDeviceAttached

//=============================================================================
void CUIGameData::OnCompletedAsyncDeviceAttached( CAsyncCtxUIOnDeviceAttached * job )
{
    ISelectStorageDeviceClient *pStorageDeviceClient = m_pSelectStorageClient;
    m_pSelectStorageClient = NULL;

    static ConVarRef mm_dlcs_mask_extras( "mm_dlcs_mask_extras" );
    if ( mm_dlcs_mask_extras.IsValid() )
    {
#ifdef _X360
        int iDLCmask = mm_dlcs_mask_extras.GetInt();

        if ( engine->IsLowViolence() && XGetGameRegion() == XC_GAME_REGION_EUROPE_REST )
        {
            // iDLCmask |= ( 1 << ? );
        }

        mm_dlcs_mask_extras.SetValue( iDLCmask );
#endif
    }

    uint nRet = job ? job->GetContainerOpenResult() : ERROR_SUCCESS;
    if ( nRet != ERROR_SUCCESS )
    {
        CloseWaitScreen( NULL, "ReportDeviceCorrupt" );
        pStorageDeviceClient->OnDeviceFail( ISelectStorageDeviceClient::FAIL_CORRUPT );
    }
    else
    {
        // Notify that data has loaded
        pStorageDeviceClient->AfterDeviceMounted();

        // Check for opening a new storage device immediately
        if ( m_pSelectStorageClient == NULL )
        {
            // Close down the waiting screen
            CloseWaitScreen( NULL, "OnCompletedAsyncDeviceAttached" );
        }
    }
}
开发者ID:SCell555,项目名称:hl2-asw-port,代码行数:40,代码来源:uigamedata_storage.cpp

示例5: Render

//-----------------------------------------------------------------------------
// Purpose: Render current view into specified rectangle
// Input  : *rect - is computed by CVideoMode_Common::GetClientViewRect()
//-----------------------------------------------------------------------------
void CViewRender::Render( vrect_t *rect )
{
	Assert(s_DbgSetupOrigin == m_View.origin);
	Assert(s_DbgSetupAngles == m_View.angles);

	VPROF_BUDGET( "CViewRender::Render", "CViewRender::Render" );
	tmZone( TELEMETRY_LEVEL0, TMZF_NONE, "%s", __FUNCTION__ );

	vrect_t vr = *rect;

	// Stub out the material system if necessary.
	CMatStubHandler matStub;

	engine->EngineStats_BeginFrame();
	
	// Assume normal vis
	m_bForceNoVis			= false;
	
	C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();


    // Set for console commands, etc.
    render->SetMainView ( m_View.origin, m_View.angles );

    for( StereoEye_t eEye = GetFirstEye(); eEye <= GetLastEye(); eEye = (StereoEye_t)(eEye+1) )
	{
		CViewSetup &view = GetView( eEye );

		#if 0 && defined( CSTRIKE_DLL )
			const bool bPlayingBackReplay = g_pEngineClientReplay && g_pEngineClientReplay->IsPlayingReplayDemo();
			if ( pPlayer && !bPlayingBackReplay )
			{
				C_BasePlayer *pViewTarget = pPlayer;

				if ( pPlayer->IsObserver() && pPlayer->GetObserverMode() == OBS_MODE_IN_EYE )
				{
					pViewTarget = dynamic_cast<C_BasePlayer*>( pPlayer->GetObserverTarget() );
				}

				if ( pViewTarget )
				{
					float targetFOV = (float)pViewTarget->m_iFOV;

					if ( targetFOV == 0 )
					{
						// FOV of 0 means use the default FOV
						targetFOV = g_pGameRules->DefaultFOV();
					}

					float deltaFOV = view.fov - m_flLastFOV;
					float FOVDirection = targetFOV - pViewTarget->m_iFOVStart;

					// Clamp FOV changes to stop FOV oscillation
					if ( ( deltaFOV < 0.0f && FOVDirection > 0.0f ) ||
						( deltaFOV > 0.0f && FOVDirection < 0.0f ) )
					{
						view.fov = m_flLastFOV;
					}

					// Catch case where FOV overshoots its target FOV
					if ( ( view.fov < targetFOV && FOVDirection <= 0.0f ) ||
						( view.fov > targetFOV && FOVDirection >= 0.0f ) )
					{
						view.fov = targetFOV;
					}

					m_flLastFOV = view.fov;
				}
			}
		#endif

	    static ConVarRef sv_restrict_aspect_ratio_fov( "sv_restrict_aspect_ratio_fov" );
	    float aspectRatio = engine->GetScreenAspectRatio() * 0.75f;	 // / (4/3)
	    float limitedAspectRatio = aspectRatio;
	    if ( ( sv_restrict_aspect_ratio_fov.GetInt() > 0 && engine->IsWindowedMode() && gpGlobals->maxClients > 1 ) ||
		    sv_restrict_aspect_ratio_fov.GetInt() == 2 )
	    {
		    limitedAspectRatio = MIN( aspectRatio, 1.85f * 0.75f ); // cap out the FOV advantage at a 1.85:1 ratio (about the widest any legit user should be)
	    }

	    view.fov = ScaleFOVByWidthRatio( view.fov, limitedAspectRatio );
	    view.fovViewmodel = ScaleFOVByWidthRatio( view.fovViewmodel, aspectRatio );

	    // Let the client mode hook stuff.
	    g_pClientMode->PreRender(&view);

	    g_pClientMode->AdjustEngineViewport( vr.x, vr.y, vr.width, vr.height );

	    ToolFramework_AdjustEngineViewport( vr.x, vr.y, vr.width, vr.height );

	    float flViewportScale = mat_viewportscale.GetFloat();

		view.m_nUnscaledX = vr.x;
		view.m_nUnscaledY = vr.y;
		view.m_nUnscaledWidth = vr.width;
		view.m_nUnscaledHeight = vr.height;
//.........这里部分代码省略.........
开发者ID:EspyEspurr,项目名称:game,代码行数:101,代码来源:view.cpp


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