Difference between revisions of "PrecacheParticleSystem"

From Valve Developer Community
Jump to: navigation, search
(Created page with 'PrecacheMaterial is a function provided to Precache particle effects by string. It is generally used to precache specific particle systems rather than every system in a particle …')
 
(Added todo about clarification)
Line 1: Line 1:
 
PrecacheMaterial is a function provided to Precache particle effects by string. It is generally used to precache specific particle systems rather than every system in a particle file.  
 
PrecacheMaterial is a function provided to Precache particle effects by string. It is generally used to precache specific particle systems rather than every system in a particle file.  
  
 
+
{{todo|Clarify if this is the .pcf name or the particle name inside the .pcf!}}
 
== Usage ==
 
== Usage ==
 
<source lang=cpp>
 
<source lang=cpp>

Revision as of 09:57, 14 April 2011

PrecacheMaterial is a function provided to Precache particle effects by string. It is generally used to precache specific particle systems rather than every system in a particle file.

To do: Clarify if this is the .pcf name or the particle name inside the .pcf!

Usage

//-----------------------------------------------------------------------------
// Precaches a particle system
//-----------------------------------------------------------------------------
void PrecacheParticleSystem( const char *pParticleSystemName )
{
	g_pStringTableParticleEffectNames->AddString( false, pParticleSystemName );
	g_pParticleSystemMgr->PrecacheParticleSystem( pParticleSystemName );
}


Examples

void CWeaponSMG1::Precache( void )
{
	PrecacheParticleSystem( "muzzle_smg1" );
}