summaryrefslogtreecommitdiff
path: root/game/client/animatedoffsettextureproxy.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/animatedoffsettextureproxy.cpp
downloadarchived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz
archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip
Diffstat (limited to 'game/client/animatedoffsettextureproxy.cpp')
-rw-r--r--game/client/animatedoffsettextureproxy.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/game/client/animatedoffsettextureproxy.cpp b/game/client/animatedoffsettextureproxy.cpp
new file mode 100644
index 0000000..bfe9fac
--- /dev/null
+++ b/game/client/animatedoffsettextureproxy.cpp
@@ -0,0 +1,56 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "cbase.h"
+#include "baseanimatedtextureproxy.h"
+
+// memdbgon must be the last include file in a .cpp file!!!
+#include "tier0/memdbgon.h"
+
+class CAnimatedOffsetTextureProxy : public CBaseAnimatedTextureProxy
+{
+public:
+ CAnimatedOffsetTextureProxy() : m_flFrameOffset( 0.0f ) {}
+
+ virtual ~CAnimatedOffsetTextureProxy() {}
+
+ virtual float GetAnimationStartTime( void* pBaseEntity );
+ virtual void OnBind( void *pBaseEntity );
+
+protected:
+
+ float m_flFrameOffset;
+};
+
+EXPOSE_INTERFACE( CAnimatedOffsetTextureProxy, IMaterialProxy, "AnimatedOffsetTexture" IMATERIAL_PROXY_INTERFACE_VERSION );
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : pArg -
+// Output : float
+//-----------------------------------------------------------------------------
+float CAnimatedOffsetTextureProxy::GetAnimationStartTime( void* pArg )
+{
+ return m_flFrameOffset;
+}
+
+//-----------------------------------------------------------------------------
+// Purpose:
+// Input : *pBaseEntity -
+//-----------------------------------------------------------------------------
+void CAnimatedOffsetTextureProxy::OnBind( void *pBaseEntity )
+{
+ C_BaseEntity* pEntity = (C_BaseEntity*)pBaseEntity;
+
+ if ( pEntity )
+ {
+ m_flFrameOffset = pEntity->GetTextureAnimationStartTime();
+ }
+
+ // Call into the base class
+ CBaseAnimatedTextureProxy::OnBind( pBaseEntity );
+}
+