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.

52 lines
1.3 KiB

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