blob: bfe9facd5b4dc3dd2c093e173ab63a715973fd37 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 );
}
|