//----------------------------------------------------------------------------- // Purpose: // Input : bool - //----------------------------------------------------------------------------- void C_TEDynamicLight::PostDataUpdate( DataUpdateType_t updateType ) { VPROF( "C_TEDynamicLight::PostDataUpdate" ); CBroadcastRecipientFilter filter; TE_DynamicLight( filter, 0.0f, &m_vecOrigin, r, g, b, exponent, m_fRadius, m_fTime, m_fDecay, LIGHT_INDEX_TE_DYNAMIC ); }
virtual void DynamicLight( IRecipientFilter& filter, float delay, const Vector* org, int r, int g, int b, int exponent, float radius, float time, float decay, int lightstyle = 0 ) { if ( !SuppressTE( filter ) ) { TE_DynamicLight( filter, delay, org, r, g, b, exponent, radius, time, decay, lightstyle ); } }
void TE_DynamicLight( IRecipientFilter& filter, float delay, KeyValues *pKeyValues ) { Vector vecOrigin; vecOrigin.x = pKeyValues->GetFloat( "originx" ); vecOrigin.y = pKeyValues->GetFloat( "originy" ); vecOrigin.z = pKeyValues->GetFloat( "originz" ); float flDuration = pKeyValues->GetFloat( "duration" ); Color c = pKeyValues->GetColor( "color" ); int nExponent = pKeyValues->GetInt( "exponent" ); float flRadius = pKeyValues->GetFloat( "radius" ); float flDecay = pKeyValues->GetFloat( "decay" ); int nLightIndex = pKeyValues->GetInt( "lightindex", LIGHT_INDEX_TE_DYNAMIC ); TE_DynamicLight( filter, 0.0f, &vecOrigin, c.r(), c.g(), c.b(), nExponent, flRadius, flDuration, flDecay, nLightIndex ); }
// For playback from external tools virtual void TriggerTempEntity( KeyValues *pKeyValues ) { g_pEffects->SuppressEffectsSounds( true ); SuppressParticleEffects( true ); // While playing back, suppress recording bool bIsRecording = clienttools->IsInRecordingMode(); clienttools->EnableRecordingMode( false ); CBroadcastRecipientFilter filter; TERecordingType_t type = (TERecordingType_t)pKeyValues->GetInt( "te" ); switch( type ) { case TE_DYNAMIC_LIGHT: TE_DynamicLight( filter, 0.0f, pKeyValues ); break; case TE_WORLD_DECAL: TE_WorldDecal( filter, 0.0f, pKeyValues ); break; case TE_DISPATCH_EFFECT: DispatchEffect( filter, 0.0f, pKeyValues ); break; case TE_MUZZLE_FLASH: { Vector vecOrigin; QAngle angles; vecOrigin.x = pKeyValues->GetFloat( "originx" ); vecOrigin.y = pKeyValues->GetFloat( "originy" ); vecOrigin.z = pKeyValues->GetFloat( "originz" ); angles.x = pKeyValues->GetFloat( "anglesx" ); angles.y = pKeyValues->GetFloat( "anglesy" ); angles.z = pKeyValues->GetFloat( "anglesz" ); float flScale = pKeyValues->GetFloat( "scale" ); int nType = pKeyValues->GetInt( "type" ); TE_MuzzleFlash( filter, 0.0f, vecOrigin, angles, flScale, nType ); } break; case TE_ARMOR_RICOCHET: { Vector vecOrigin, vecDirection; vecOrigin.x = pKeyValues->GetFloat( "originx" ); vecOrigin.y = pKeyValues->GetFloat( "originy" ); vecOrigin.z = pKeyValues->GetFloat( "originz" ); vecDirection.x = pKeyValues->GetFloat( "directionx" ); vecDirection.y = pKeyValues->GetFloat( "directiony" ); vecDirection.z = pKeyValues->GetFloat( "directionz" ); TE_ArmorRicochet( filter, 0.0f, &vecOrigin, &vecDirection ); } break; case TE_METAL_SPARKS: { Vector vecOrigin, vecDirection; vecOrigin.x = pKeyValues->GetFloat( "originx" ); vecOrigin.y = pKeyValues->GetFloat( "originy" ); vecOrigin.z = pKeyValues->GetFloat( "originz" ); vecDirection.x = pKeyValues->GetFloat( "directionx" ); vecDirection.y = pKeyValues->GetFloat( "directiony" ); vecDirection.z = pKeyValues->GetFloat( "directionz" ); TE_MetalSparks( filter, 0.0f, &vecOrigin, &vecDirection ); } break; case TE_SMOKE: { Vector vecOrigin, vecDirection; vecOrigin.x = pKeyValues->GetFloat( "originx" ); vecOrigin.y = pKeyValues->GetFloat( "originy" ); vecOrigin.z = pKeyValues->GetFloat( "originz" ); float flScale = pKeyValues->GetFloat( "scale" ); int nFrameRate = pKeyValues->GetInt( "framerate" ); TE_Smoke( filter, 0.0f, &vecOrigin, 0, flScale, nFrameRate ); } break; case TE_SPARKS: { Vector vecOrigin, vecDirection; vecOrigin.x = pKeyValues->GetFloat( "originx" ); vecOrigin.y = pKeyValues->GetFloat( "originy" ); vecOrigin.z = pKeyValues->GetFloat( "originz" ); vecDirection.x = pKeyValues->GetFloat( "directionx" ); vecDirection.y = pKeyValues->GetFloat( "directiony" ); vecDirection.z = pKeyValues->GetFloat( "directionz" ); int nMagnitude = pKeyValues->GetInt( "magnitude" ); int nTrailLength = pKeyValues->GetInt( "traillength" ); TE_Sparks( filter, 0.0f, &vecOrigin, nMagnitude, nTrailLength, &vecDirection ); } break; case TE_BLOOD_STREAM: TE_BloodStream( filter, 0.0f, pKeyValues ); break; case TE_BLOOD_SPRITE: TE_BloodSprite( filter, 0.0f, pKeyValues ); break; case TE_BREAK_MODEL: TE_BreakModel( filter, 0.0f, pKeyValues ); break; case TE_GLOW_SPRITE: TE_GlowSprite( filter, 0.0f, pKeyValues ); break; case TE_PHYSICS_PROP: TE_PhysicsProp( filter, 0.0f, pKeyValues ); break; case TE_SPRITE_SINGLE: TE_Sprite( filter, 0.0f, pKeyValues ); break; case TE_SPRITE_SPRAY: TE_SpriteSpray( filter, 0.0f, pKeyValues ); break; case TE_SHATTER_SURFACE: TE_ShatterSurface( filter, 0.0f, pKeyValues ); break; case TE_DECAL: TE_Decal( filter, 0.0f, pKeyValues ); break; case TE_PROJECT_DECAL: TE_ProjectDecal( filter, 0.0f, pKeyValues ); break; case TE_EXPLOSION: TE_Explosion( filter, 0.0f, pKeyValues ); break; #ifdef HL2_DLL case TE_CONCUSSIVE_EXPLOSION: TE_ConcussiveExplosion( filter, 0.0f, pKeyValues ); break; #endif } SuppressParticleEffects( false ); g_pEffects->SuppressEffectsSounds( false ); clienttools->EnableRecordingMode( bIsRecording ); }