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


C++ ToolsEnabled函数代码示例

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


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

示例1: Assert

void CSubtractProxy::OnBind( void *pC_BaseEntity )
{
	Assert( m_pSrc1 && m_pSrc2 && m_pResult );

	MaterialVarType_t resultType;
	int vecSize;
	ComputeResultType( resultType, vecSize );

	switch( resultType )
	{
	case MATERIAL_VAR_TYPE_VECTOR:
		{
			Vector a, b, c;
			m_pSrc1->GetVecValue( a.Base(), vecSize ); 
			m_pSrc2->GetVecValue( b.Base(), vecSize ); 
			VectorSubtract( a, b, c );
			m_pResult->SetVecValue( c.Base(), vecSize );
		}
		break;

	case MATERIAL_VAR_TYPE_FLOAT:
		SetFloatResult( m_pSrc1->GetFloatValue() - m_pSrc2->GetFloatValue() );
		break;

	case MATERIAL_VAR_TYPE_INT:
		m_pResult->SetFloatValue( m_pSrc1->GetIntValue() - m_pSrc2->GetIntValue() );
		break;
	}

	if ( ToolsEnabled() )
	{
		ToolFramework_RecordMaterialParams( GetMaterial() );
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:34,代码来源:mathproxy.cpp

示例2: 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

示例3: RecordBloodSprite

//-----------------------------------------------------------------------------
// 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

示例4: 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

示例5: BindArgToEntity

void CPlayerViewProxy::OnBind( void *pC_BaseEntity )
{
	if (!pC_BaseEntity)
		return;

	// Find the view angle between the player and this entity....
	C_BaseEntity *pEntity = BindArgToEntity( pC_BaseEntity );
	C_BaseEntity* pPlayer = C_BasePlayer::GetLocalPlayer();
	if (!pPlayer)
		return;

	Vector delta;
	VectorSubtract( pEntity->WorldSpaceCenter(), pPlayer->WorldSpaceCenter(), delta );
	VectorNormalize( delta );

	Vector forward;
	AngleVectors( pPlayer->GetAbsAngles(), &forward );

	Assert( m_pResult );
	SetFloatResult( DotProduct( forward, delta ) * m_Factor );

	if ( ToolsEnabled() )
	{
		ToolFramework_RecordMaterialParams( GetMaterial() );
	}
}
开发者ID:Entropy-Soldier,项目名称:ges-legacy-code,代码行数:26,代码来源:proxyplayer.cpp

示例6: RecordDecal

//-----------------------------------------------------------------------------
// Recording 
//-----------------------------------------------------------------------------
static inline void RecordDecal( const Vector &pos, const Vector &start, 
	int entity, int hitbox, int index )
{
	if ( !ToolsEnabled() )
		return;

	if ( clienttools->IsInRecordingMode() )
	{
		// FIXME: Can't record on entities yet
		if ( entity != 0 )
			return;

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

 		msg->SetInt( "te", TE_DECAL );
 		msg->SetString( "name", "TE_Decal" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", pos.x );
		msg->SetFloat( "originy", pos.y );
		msg->SetFloat( "originz", pos.z );
		msg->SetFloat( "startx", start.x );
		msg->SetFloat( "starty", start.y );
		msg->SetFloat( "startz", start.z );
		msg->SetInt( "hitbox", hitbox );
		msg->SetString( "decalname", effects->Draw_DecalNameFromIndex( index ) );

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

示例7: if

void CGaussianNoiseProxy::OnBind( void *pC_BaseEntity )
{
	float flMean = m_Mean.GetFloat();
	float flStdDev = m_StdDev.GetFloat();
	float flVal = randomgaussian->RandomFloat( flMean, flStdDev );
	float flMaxVal = m_flMaxVal.GetFloat();
	float flMinVal = m_flMinVal.GetFloat();

	if (flMinVal > flMaxVal)
	{
		float flTemp = flMinVal;
		flMinVal = flMaxVal;
		flMaxVal = flTemp;
	}

	// clamp
	if (flVal < flMinVal)
		flVal = flMinVal;
	else if ( flVal > flMaxVal )
		flVal = flMaxVal;

	SetFloatResult( flVal );

	if ( ToolsEnabled() )
	{
		ToolFramework_RecordMaterialParams( GetMaterial() );
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:28,代码来源:mathproxy.cpp

示例8: exp

void CExponentialProxy::OnBind( void *pC_BaseEntity )
{	
	float flVal = m_Scale.GetFloat() * exp(m_pSrc1->GetFloatValue( ) + m_Offset.GetFloat());

	float flMaxVal = m_flMaxVal.GetFloat();
	float flMinVal = m_flMinVal.GetFloat();

	if (flMinVal > flMaxVal)
	{
		float flTemp = flMinVal;
		flMinVal = flMaxVal;
		flMaxVal = flTemp;
	}

	// clamp
	if (flVal < flMinVal)
		flVal = flMinVal;
	else if ( flVal > flMaxVal )
		flVal = flMaxVal;

	SetFloatResult( flVal );

	if ( ToolsEnabled() )
	{
		ToolFramework_RecordMaterialParams( GetMaterial() );
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:27,代码来源:mathproxy.cpp

示例9: 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

示例10: RecordExplosion

//-----------------------------------------------------------------------------
// Recording 
//-----------------------------------------------------------------------------
void C_TEExplosion::RecordExplosion( )
{
	if ( !ToolsEnabled() )
		return;

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

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

 		msg->SetInt( "te", TE_EXPLOSION );
 		msg->SetString( "name", "TE_Explosion" );
		msg->SetFloat( "time", gpGlobals->curtime );
		msg->SetFloat( "originx", m_vecOrigin.x );
		msg->SetFloat( "originy", m_vecOrigin.y );
		msg->SetFloat( "originz", m_vecOrigin.z );
		msg->SetFloat( "directionx", m_vecNormal.x );
		msg->SetFloat( "directiony", m_vecNormal.y );
		msg->SetFloat( "directionz", m_vecNormal.z );
  		msg->SetString( "model", pModelName );
		msg->SetFloat( "scale", m_fScale );
		msg->SetInt( "framerate", m_nFrameRate );
		msg->SetInt( "flags", m_nFlags );
		msg->SetInt( "materialtype", m_chMaterialType );
		msg->SetInt( "radius", m_nRadius );
		msg->SetInt( "magnitude", m_nMagnitude );

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

示例11: 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

示例12: switch

void CMaterialModifyProxy::OnBind( void *pEntity )
{
	// Get the modified material vars from the entity input
	IClientRenderable *pRend = (IClientRenderable *)pEntity;
	if ( pRend )
	{
		C_BaseEntity *pBaseEntity = pRend->GetIClientUnknown()->GetBaseEntity();
		
		if ( pBaseEntity )
		{
			if( debug_materialmodifycontrol_client.GetBool() )
			{
//				DevMsg( 1, "%s\n", pBaseEntity->GetDebugName() );
			}
			int numChildren = 0;
			bool gotOne = false;
			for ( C_BaseEntity *pChild = pBaseEntity->FirstMoveChild(); pChild; pChild = pChild->NextMovePeer() )
			{
				numChildren++;
				C_MaterialModifyControl *pControl = dynamic_cast<C_MaterialModifyControl*>( pChild );
				if ( !pControl )
					continue;

				if( debug_materialmodifycontrol_client.GetBool() )
				{
//					DevMsg( 1, "pControl: 0x%p\n", pControl );
				}
				
				switch( pControl->GetModifyMode() )
				{
				case MATERIAL_MODIFY_MODE_NONE:
					break;
				case MATERIAL_MODIFY_MODE_SETVAR:
					gotOne = true;
					OnBindSetVar( pControl );
					break;
				case MATERIAL_MODIFY_MODE_ANIM_SEQUENCE:
					OnBindAnimatedTexture( pControl );
					break;
				case MATERIAL_MODIFY_MODE_FLOAT_LERP:
					OnBindFloatLerp( pControl );
					break;
				default:
					Assert( 0 );
					break;
				}
			}
			if( gotOne )
			{
//				DevMsg( 1, "numChildren: %d\n", numChildren );
			}
		}
	}

	if ( ToolsEnabled() )
	{
		ToolFramework_RecordMaterialParams( GetMaterial() );
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:59,代码来源:C_MaterialModifyControl.cpp

示例13: SetFloatResult

void CUniformNoiseProxy::OnBind( void *pC_BaseEntity )
{
	SetFloatResult( random->RandomFloat( m_flMinVal.GetFloat(), m_flMaxVal.GetFloat() ) );

	if ( ToolsEnabled() )
	{
		ToolFramework_RecordMaterialParams( GetMaterial() );
	}
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:9,代码来源:mathproxy.cpp

示例14: ToolsEnabled

//-----------------------------------------------------------------------------
// Helper class to indicate ownership of effects
//-----------------------------------------------------------------------------
CRecordEffectOwner::CRecordEffectOwner( C_BaseEntity *pEntity, bool bIsViewModel )
{
	m_bToolsEnabled = ToolsEnabled() && clienttools->IsInRecordingMode();
	if ( m_bToolsEnabled )
	{
		KeyValues *msg = new KeyValues( "EffectsOwner" );
		msg->SetInt( "viewModel", bIsViewModel );
		ToolFramework_PostToolMessage( pEntity ? pEntity->GetToolHandle() : HTOOLHANDLE_INVALID, msg );
		msg->deleteThis();
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:14,代码来源:toolframework_client.cpp

示例15: defined

CBaseParticleEntity::~CBaseParticleEntity( void )
{
#if defined( CLIENT_DLL )
	if ( ToolsEnabled() && ( m_nToolParticleEffectId != TOOLPARTICLESYSTEMID_INVALID ) && clienttools->IsInRecordingMode() )
	{
		KeyValues *msg = new KeyValues( "ParticleSystem_Destroy" );
		msg->SetInt( "id", m_nToolParticleEffectId );
		m_nToolParticleEffectId = TOOLPARTICLESYSTEMID_INVALID; 
	}
#endif
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:11,代码来源:baseparticleentity.cpp


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