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


C++ KeyValues::SetInt方法代码示例

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


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

示例1: TurnOff

//================================================================================
// Apaga y destruye la luz
//================================================================================
void CInternalLight::TurnOff()
{
    // No esta encendida
    if ( !IsOn() )
        return;

    m_bIsOn = false;

    // Destruimos la luz
    if ( m_nLightHandle != CLIENTSHADOW_INVALID_HANDLE ) {
        g_pClientShadowMgr->DestroyFlashlight( m_nLightHandle );
        m_nLightHandle = CLIENTSHADOW_INVALID_HANDLE;
    }

#ifndef NO_TOOLFRAMEWORK
    if ( clienttools->IsInRecordingMode() ) {
        KeyValues *msg = new KeyValues( "FlashlightState" );
        msg->SetFloat( "time", gpGlobals->curtime );
        msg->SetInt( "entindex", m_iEntIndex );
        msg->SetInt( "flashlightHandle", m_nLightHandle );
        msg->SetPtr( "flashlightState", NULL );
        ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
        msg->deleteThis();
    }
#endif
}
开发者ID:WootsMX,项目名称:InSource,代码行数:29,代码来源:c_projectedlight.cpp

示例2: Update

//================================================================================
// Pensamiento
//================================================================================
void CInternalLight::Update( const Vector &vecPos, const Vector &vecForward, const Vector &vecRight, const Vector &vecUp )
{
    VPROF_BUDGET( __FUNCTION__, VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING );

    // No esta encendida
    if ( !IsOn() )
        return;

    FlashlightState_t state;

    // Actualizamos el estado
    if ( !UpdateState( state, vecPos, vecForward, vecRight, vecUp ) )
        return;

    // Actualizamos la proyección de la luz
    UpdateLightProjection( state );

#ifndef NO_TOOLFRAMEWORK
    if ( clienttools->IsInRecordingMode() ) {
        KeyValues *msg = new KeyValues( "FlashlightState" );
        msg->SetFloat( "time", gpGlobals->curtime );
        msg->SetInt( "entindex", m_iEntIndex );
        msg->SetInt( "flashlightHandle", m_nLightHandle );
        msg->SetPtr( "flashlightState", &state );
        ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
        msg->deleteThis();
    }
#endif
}
开发者ID:WootsMX,项目名称:InSource,代码行数:32,代码来源:c_projectedlight.cpp

示例3: RefreshPerforceState

//-----------------------------------------------------------------------------
// Refresh perforce information
//-----------------------------------------------------------------------------
void PerforceFileList::RefreshPerforceState( int nItemID, bool bFileExists, P4File_t *pFileInfo )
{
    KeyValues *kv = GetItem( nItemID );

    bool bIsSynched = false;
    bool bIsFileInPerforce = (pFileInfo != NULL);
    if ( bIsFileInPerforce )
    {
        if ( pFileInfo->m_bDeleted != bFileExists )
        {
            bIsSynched = ( pFileInfo->m_bDeleted || ( pFileInfo->m_iHeadRevision == pFileInfo->m_iHaveRevision ) );
        }
    }
    else
    {
        bIsSynched = !bFileExists;
    }

    bool bIsDeleted = bIsFileInPerforce && !bFileExists && pFileInfo->m_bDeleted;

    kv->SetInt( "in_perforce", bIsFileInPerforce );
    kv->SetInt( "synched", bIsSynched );
    kv->SetInt( "checked_out", bIsFileInPerforce && ( pFileInfo->m_eOpenState != P4FILE_UNOPENED ) );
    kv->SetInt( "deleted", bIsDeleted );

    if ( bIsDeleted )
    {
        SetItemVisible( nItemID, m_bShowDeletedFiles );
    }
}
开发者ID:GOGIBERRY,项目名称:source-sdk-2013,代码行数:33,代码来源:PerforceFileList.cpp

示例4:

KeyValues *CNodeFinal::AllocateKeyValues( int NodeIndex )
{
	KeyValues *pKV = BaseClass::AllocateKeyValues( NodeIndex );
	pKV->SetInt( "i_final_tonemap", i_tonemaptype );
	pKV->SetInt( "i_final_wdepth", b_writedepth ? 1 : 0 );
	return pKV;
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:7,代码来源:vnode_final.cpp

示例5: RecordPhysicsProp

//-----------------------------------------------------------------------------
// Recording 
//-----------------------------------------------------------------------------
static inline void RecordPhysicsProp( const Vector& start, const QAngle &angles, 
	const Vector& vel, int nModelIndex, int flags, int nSkin, int nEffects )
{
	if ( !ToolsEnabled() )
		return;

	if ( clienttools->IsInRecordingMode() )
	{
		const model_t* pModel = (nModelIndex != 0) ? modelinfo->GetModel( nModelIndex ) : NULL;
		const char *pModelName = pModel ? modelinfo->GetModelName( pModel ) : "";

		KeyValues *msg = new KeyValues( "TempEntity" );

 		msg->SetInt( "te", TE_PHYSICS_PROP );
 		msg->SetString( "name", "TE_PhysicsProp" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", start.x );
		msg->SetFloat( "originy", start.y );
		msg->SetFloat( "originz", start.z );
		msg->SetFloat( "anglesx", angles.x );
		msg->SetFloat( "anglesy", angles.y );
		msg->SetFloat( "anglesz", angles.z );
		msg->SetFloat( "velx", vel.x );
		msg->SetFloat( "vely", vel.y );
		msg->SetFloat( "velz", vel.z );
  		msg->SetString( "model", pModelName );
 		msg->SetInt( "breakmodel", flags );
		msg->SetInt( "skin", nSkin );
		msg->SetInt( "effects", nEffects );

		ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
		msg->deleteThis();
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:37,代码来源:c_te_physicsprop.cpp

示例6: GetKeyValuesForEditor

KeyValues* CASW_Reward::GetKeyValuesForEditor()
{
    switch( m_RewardType )
    {
    case ASW_REWARD_MONEY:
    {
        KeyValues *pReward = new KeyValues( "MoneyReward");
        pReward->SetInt( NULL, m_iRewardAmount );
        return pReward;
    }
    case ASW_REWARD_XP:
    {
        KeyValues *pReward = new KeyValues( "XPReward");
        pReward->SetInt( NULL, m_iRewardAmount );
        return pReward;
    }
    case ASW_REWARD_ITEM:
    {
        KeyValues *pReward = new KeyValues( "ItemReward");
        pReward->SetString( "ItemName", m_szRewardName );
        pReward->SetInt( "ItemLevel", m_iRewardLevel );
        pReward->SetInt( "ItemQuality", m_iRewardQuality );
        return pReward;
    }
    }
    return NULL;
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:27,代码来源:asw_location_grid.cpp

示例7: RecordMuzzleFlash

//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordMuzzleFlash( const Vector &start, const QAngle &angles, float scale, int type )
{
	if ( !ToolsEnabled() )
		return;

	if ( clienttools->IsInRecordingMode() )
	{
		KeyValues *msg = new KeyValues( "TempEntity" );

 		msg->SetInt( "te", TE_MUZZLE_FLASH );
 		msg->SetString( "name", "TE_MuzzleFlash" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", start.x );
		msg->SetFloat( "originy", start.y );
		msg->SetFloat( "originz", start.z );
		msg->SetFloat( "anglesx", angles.x );
		msg->SetFloat( "anglesy", angles.y );
		msg->SetFloat( "anglesz", angles.z );
		msg->SetFloat( "scale", scale );
		msg->SetInt( "type", type );

		ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
		msg->deleteThis();
	}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:28,代码来源:c_te_muzzleflash.cpp

示例8: ExpandTreeNode

//-----------------------------------------------------------------------------
// Purpose: expands a path
//-----------------------------------------------------------------------------
void DirectorySelectDialog::ExpandTreeNode(const char *path, int parentNodeIndex)
{
	// set the small wait cursor
	surface()->SetCursor(dc_waitarrow);

	// get all the subfolders of the current drive
	char searchString[512];
	sprintf(searchString, "%s*.*", path);

	FileFindHandle_t h;
	const char *pFileName = g_pFullFileSystem->FindFirstEx( searchString, NULL, &h );
	for ( ; pFileName; pFileName = g_pFullFileSystem->FindNext( h ) )
	{
		if ( !Q_stricmp( pFileName, ".." ) || !Q_stricmp( pFileName, "." ) )
			continue;

		KeyValues *kv = new KeyValues("item");
		kv->SetString("Text", pFileName);
		// set the folder image
		kv->SetInt("Image", 1);
		kv->SetInt("SelectedImage", 1);
		kv->SetInt("Expand", DoesDirectoryHaveSubdirectories(path, pFileName));	
		m_pDirTree->AddItem(kv, parentNodeIndex);
	}
	g_pFullFileSystem->FindClose( h );
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:29,代码来源:DirectorySelectDialog.cpp

示例9: AddRoomInstance

void VMFExporter::AddRoomInstance( const CRoomTemplate *pRoomTemplate, int nPlacedRoomIndex )
{
    KeyValues *pFuncInstance = new KeyValues( "entity" );
    pFuncInstance->SetInt( "id", ++ m_iEntityCount );
    pFuncInstance->SetString( "classname", "func_instance" );
    pFuncInstance->SetString( "angles", "0 0 0" );

    // Used to identify rooms for later fixup (e.g. adding/swapping instances and models)
    if ( nPlacedRoomIndex != -1 )
    {
        pFuncInstance->SetInt( "PlacedRoomIndex", nPlacedRoomIndex );
    }

    char vmfName[MAX_PATH];
    Q_snprintf( vmfName, sizeof( vmfName ), "tilegen/roomtemplates/%s/%s.vmf", pRoomTemplate->m_pLevelTheme->m_szName, pRoomTemplate->GetFullName() );
    // Convert backslashes to forward slashes to please the VMF parser
    int nStrLen = Q_strlen( vmfName );
    for ( int i = 0; i < nStrLen; ++ i )
    {
        if ( vmfName[i] == '\\' ) vmfName[i] = '/';
    }

    pFuncInstance->SetString( "file", vmfName );

    Vector vOrigin = GetCurrentRoomOffset();
    char buf[128];
    Q_snprintf( buf, 128, "%f %f %f", vOrigin.x, vOrigin.y, vOrigin.z );
    pFuncInstance->SetString( "origin", buf );
    m_pExportKeys->AddSubKey( pFuncInstance );
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:30,代码来源:VMFExporter.cpp

示例10: RecordSprite

//-----------------------------------------------------------------------------
// Recording 
//-----------------------------------------------------------------------------
static inline void RecordSprite( const Vector& start, int nModelIndex, 
								 float flScale, int nBrightness )
{
	if ( !ToolsEnabled() )
		return;

	if ( clienttools->IsInRecordingMode() )
	{
		const model_t* pModel = (nModelIndex != 0) ? modelinfo->GetModel( nModelIndex ) : NULL;
		const char *pModelName = pModel ? modelinfo->GetModelName( pModel ) : "";

		KeyValues *msg = new KeyValues( "TempEntity" );

 		msg->SetInt( "te", TE_SPRITE_SINGLE );
 		msg->SetString( "name", "TE_Sprite" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", start.x );
		msg->SetFloat( "originy", start.y );
		msg->SetFloat( "originz", start.z );
  		msg->SetString( "model", pModelName );
 		msg->SetFloat( "scale", flScale );
 		msg->SetInt( "brightness", nBrightness );

		ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
		msg->deleteThis();
	}
}
开发者ID:1n73rf4c3,项目名称:source-sdk-2013,代码行数:30,代码来源:c_te_sprite.cpp

示例11: SaveAsAnimFile

void CViewAngleAnimation::SaveAsAnimFile( const char *pKeyFrameFileName )
{
	// save all of our keyframes into the file
	KeyValues *pData = new KeyValues( pKeyFrameFileName );

	pData->SetInt( "flags", m_iFlags );

	KeyValues *pKey = new KeyValues( "keyframe" );
	int i;
	int c = m_KeyFrames.Count();
	char buf[64];
	for ( i=0;i<c;i++ )
	{
		pKey = pData->CreateNewKey();

		Q_snprintf( buf, sizeof(buf), "%f %f %f",
			m_KeyFrames[i]->m_vecAngles[0],
			m_KeyFrames[i]->m_vecAngles[1],
			m_KeyFrames[i]->m_vecAngles[2] );

		pKey->SetString( "angles", buf );
		pKey->SetFloat( "time", m_KeyFrames[i]->m_flTime );
		pKey->SetInt( "flags", m_KeyFrames[i]->m_iFlags );
	}

	pData->SaveToFile( filesystem, pKeyFrameFileName, NULL );
	pData->deleteThis();
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:28,代码来源:viewangleanim.cpp

示例12: clr

//-----------------------------------------------------------------------------
// Recording 
//-----------------------------------------------------------------------------
static inline void RecordBloodSprite( const Vector &start, const Vector &direction, 
	int r, int g, int b, int a, int nSprayModelIndex, int nDropModelIndex, int size )
{
	if ( !ToolsEnabled() )
		return;

	if ( clienttools->IsInRecordingMode() )
	{
		Color clr( r, g, b, a );

		const model_t* pSprayModel = (nSprayModelIndex != 0) ? modelinfo->GetModel( nSprayModelIndex ) : NULL;
		const model_t* pDropModel = (nDropModelIndex != 0) ? modelinfo->GetModel( nDropModelIndex ) : NULL;
		const char *pSprayModelName = pSprayModel ? modelinfo->GetModelName( pSprayModel ) : "";
		const char *pDropModelName = pDropModel ? modelinfo->GetModelName( pDropModel ) : "";

		KeyValues *msg = new KeyValues( "TempEntity" );

 		msg->SetInt( "te", TE_BLOOD_SPRITE );
 		msg->SetString( "name", "TE_BloodSprite" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", start.x );
		msg->SetFloat( "originy", start.y );
		msg->SetFloat( "originz", start.z );
		msg->SetFloat( "directionx", direction.x );
		msg->SetFloat( "directiony", direction.y );
		msg->SetFloat( "directionz", direction.z );
		msg->SetColor( "color", clr );
  		msg->SetString( "spraymodel", pSprayModelName );
 		msg->SetString( "dropmodel", pDropModelName );
		msg->SetInt( "size", size );

		ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
		msg->deleteThis();
	}
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:38,代码来源:c_te_bloodsprite.cpp

示例13:

KeyValues *CNodeMCompose::AllocateKeyValues( int NodeIndex )
{
	KeyValues *pKV = BaseClass::AllocateKeyValues( NodeIndex );
	pKV->SetInt( "i_mcomp_matrix", iTargetMatrix );
	pKV->SetInt( "i_mcomp_c", bColumns ? 1 : 0 );
	return pKV;
}
开发者ID:Biohazard90,项目名称:source-shader-editor,代码行数:7,代码来源:vnode_mcompose.cpp

示例14: Init

//-----------------------------------------------------------------------------
// initialization, shutdown
//-----------------------------------------------------------------------------
bool CProceduralTexturePanel::Init( int nWidth, int nHeight, bool bAllocateImageBuffer )
{
	m_nWidth = nWidth;
	m_nHeight = nHeight;
	if ( bAllocateImageBuffer )
	{
		m_pImageBuffer = new BGRA8888_t[nWidth * nHeight];
	}
	
	m_TextureSubRect.x = m_TextureSubRect.y = 0;
	m_TextureSubRect.width = nWidth;
	m_TextureSubRect.height = nHeight;

	char pTemp[512];
	Q_snprintf( pTemp, 512, "__%s", GetName() );

	ITexture *pTex = MaterialSystem()->CreateProceduralTexture( pTemp, TEXTURE_GROUP_VGUI,
			m_nWidth, m_nHeight, IMAGE_FORMAT_BGRX8888, 
			TEXTUREFLAGS_CLAMPS | TEXTUREFLAGS_CLAMPT | TEXTUREFLAGS_NOMIP | 
			TEXTUREFLAGS_NOLOD | TEXTUREFLAGS_PROCEDURAL | TEXTUREFLAGS_SINGLECOPY );
	pTex->SetTextureRegenerator( this );
	m_ProceduralTexture.Init( pTex );

	KeyValues *pVMTKeyValues = new KeyValues( "UnlitGeneric" );
	pVMTKeyValues->SetString( "$basetexture", pTemp );
	pVMTKeyValues->SetInt( "$nocull", 1 );
	pVMTKeyValues->SetInt( "$nodebug", 1 );
	m_ProceduralMaterial.Init( MaterialSystem()->CreateMaterial( pTemp, pVMTKeyValues ));

	m_nTextureID = MatSystemSurface()->CreateNewTextureID( false );
	MatSystemSurface()->DrawSetTextureMaterial( m_nTextureID, m_ProceduralMaterial );
	return true;
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:36,代码来源:proceduraltexturepanel.cpp

示例15: RecordSparks

//-----------------------------------------------------------------------------
// Recording
//-----------------------------------------------------------------------------
static inline void RecordSparks( const Vector &start, int nMagnitude, int nTrailLength, const Vector &direction )
{
	if ( !ToolsEnabled() )
		return;

	if ( clienttools->IsInRecordingMode() )
	{
		KeyValues *msg = new KeyValues( "TempEntity" );

 		msg->SetInt( "te", TE_SPARKS );
 		msg->SetString( "name", "TE_Sparks" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", start.x );
		msg->SetFloat( "originy", start.y );
		msg->SetFloat( "originz", start.z );
		msg->SetFloat( "directionx", direction.x );
		msg->SetFloat( "directiony", direction.y );
		msg->SetFloat( "directionz", direction.z );
		msg->SetInt( "magnitude", nMagnitude );
		msg->SetInt( "traillength", nTrailLength );

		ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
		msg->deleteThis();
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:28,代码来源:c_te_sparks.cpp


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