Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "baseanimatedtextureproxy.h"
  8. #include "imaterialproxydict.h"
  9. // memdbgon must be the last include file in a .cpp file!!!
  10. #include "tier0/memdbgon.h"
  11. class CAnimatedOffsetTextureProxy : public CBaseAnimatedTextureProxy
  12. {
  13. public:
  14. CAnimatedOffsetTextureProxy() : m_flFrameOffset( 0.0f ) {}
  15. virtual ~CAnimatedOffsetTextureProxy() {}
  16. virtual float GetAnimationStartTime( void* pBaseEntity );
  17. virtual void OnBind( void *pBaseEntity );
  18. protected:
  19. float m_flFrameOffset;
  20. };
  21. EXPOSE_MATERIAL_PROXY( CAnimatedOffsetTextureProxy, AnimatedOffsetTexture );
  22. //-----------------------------------------------------------------------------
  23. // Purpose:
  24. // Input : pArg -
  25. // Output : float
  26. //-----------------------------------------------------------------------------
  27. float CAnimatedOffsetTextureProxy::GetAnimationStartTime( void* pArg )
  28. {
  29. return m_flFrameOffset;
  30. }
  31. //-----------------------------------------------------------------------------
  32. // Purpose:
  33. // Input : *pBaseEntity -
  34. //-----------------------------------------------------------------------------
  35. void CAnimatedOffsetTextureProxy::OnBind( void *pBaseEntity )
  36. {
  37. C_BaseEntity* pEntity = (C_BaseEntity*)pBaseEntity;
  38. if ( pEntity )
  39. {
  40. m_flFrameOffset = pEntity->GetTextureAnimationStartTime();
  41. }
  42. // Call into the base class
  43. CBaseAnimatedTextureProxy::OnBind( pBaseEntity );
  44. }