summaryrefslogtreecommitdiff
path: root/game/client/tf/tf_proxyentity.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/tf_proxyentity.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf/tf_proxyentity.cpp')
-rw-r--r--game/client/tf/tf_proxyentity.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/game/client/tf/tf_proxyentity.cpp b/game/client/tf/tf_proxyentity.cpp
new file mode 100644
index 0000000..cd7b86b
--- /dev/null
+++ b/game/client/tf/tf_proxyentity.cpp
@@ -0,0 +1,45 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: A base class for all material proxies in the tf client dll
+//
+// $NoKeywords: $
+//=============================================================================//
+#include "cbase.h"
+#include "tf_proxyentity.h"
+#include "materialsystem/imaterialvar.h"
+
+
+CBaseInvisMaterialProxy::CBaseInvisMaterialProxy()
+{
+ m_pPercentInvisible = NULL;
+}
+
+
+bool CBaseInvisMaterialProxy::Init( IMaterial *pMaterial, KeyValues* pKeyValues )
+{
+ bool bFound;
+ m_pPercentInvisible = pMaterial->FindVar( "$cloakfactor", &bFound );
+
+ return bFound;
+}
+
+void CBaseInvisMaterialProxy::Release()
+{
+ delete this;
+}
+
+IMaterial *CBaseInvisMaterialProxy::GetMaterial()
+{
+ if ( !m_pPercentInvisible )
+ return NULL;
+
+ return m_pPercentInvisible->GetOwningMaterial();
+}
+
+void CBaseInvisMaterialProxy::OnBindNotEntity( void *pRenderable )
+{
+ if ( m_pPercentInvisible )
+ {
+ m_pPercentInvisible->SetFloatValue( 0.0f );
+ }
+}