本文整理汇总了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
}
示例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
}
示例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 );
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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 );
}
示例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 );
}
示例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();
}
}
示例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();
}
示例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();
}
}
示例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;
}
示例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;
}
示例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();
}
}