diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/animatedoffsettextureproxy.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/animatedoffsettextureproxy.cpp')
| -rw-r--r-- | game/client/animatedoffsettextureproxy.cpp | 56 |
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 ); +} + |