diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/client/fx_quad.cpp | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.tar.xz source-sdk-2013-0d8dceea4310fde5706b3ce1c70609d72a38efdf.zip | |
Diffstat (limited to 'mp/src/game/client/fx_quad.cpp')
| -rw-r--r-- | mp/src/game/client/fx_quad.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/mp/src/game/client/fx_quad.cpp b/mp/src/game/client/fx_quad.cpp index 6a254b97..12d95b7d 100644 --- a/mp/src/game/client/fx_quad.cpp +++ b/mp/src/game/client/fx_quad.cpp @@ -13,11 +13,21 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" -CFXQuad::CFXQuad( const FXQuadData_t &data ) +static const char g_EffectName[] = "Quad"; -: CClientSideEffect( "Quad" ) +CFXQuad::CFXQuad( const FXQuadData_t &data ) + : CClientSideEffect( g_EffectName ) { m_FXData = data; + + if ( data.m_pMaterial != NULL ) + { + // If we've got a material, use that as our effectname instead of just "Quad". + // This should hopefully help narrow down messages like "No room for effect Quad". + const char *szMaterialName = data.m_pMaterial->GetName(); + if ( szMaterialName ) + SetEffectName( szMaterialName ); + } } CFXQuad::~CFXQuad( void ) @@ -62,6 +72,12 @@ void CFXQuad::Draw( double frametime ) float alpha = m_FXData.m_flStartAlpha + ( ( m_FXData.m_flEndAlpha - m_FXData.m_flStartAlpha ) * alphaTimePerc ); alpha = clamp( alpha, 0.0f, 1.0f ); + + // PASSTIME don't bother if alpha is 0 + if ( alpha == 0 ) + { + return; + } CMatRenderContextPtr pRenderContext( materials ); @@ -152,6 +168,8 @@ bool CFXQuad::IsActive( void ) //----------------------------------------------------------------------------- void CFXQuad::Destroy( void ) { + SetEffectName( g_EffectName ); + //Release the material if ( m_FXData.m_pMaterial != NULL ) { |