mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
Added original SDK code for Alien Swarm.
This commit is contained in:
57
game/client/animatedoffsettextureproxy.cpp
Normal file
57
game/client/animatedoffsettextureproxy.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#include "cbase.h"
|
||||
#include "BaseAnimatedTextureProxy.h"
|
||||
|
||||
#include "imaterialproxydict.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_MATERIAL_PROXY( CAnimatedOffsetTextureProxy, AnimatedOffsetTexture );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user