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.

43 lines
1.1 KiB

  1. //========= Copyright � 1996-2012, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Provide custom material swapping for weapons (when switch from world to view or vice versa)
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CS_CUSTOM_MATERIAL_SWAP_H
  8. #define CS_CUSTOM_MATERIAL_SWAP_H
  9. class ICustomMaterial;
  10. struct CCSPendingCustomMaterialSwap_t
  11. {
  12. ICustomMaterial *m_pNewCustomMaterial;
  13. ICustomMaterial *m_pOldCustomMaterial;
  14. int m_nCustomMaterialIndex;
  15. EHANDLE m_hOwner;
  16. };
  17. class CCSCustomMaterialSwapManager : public CAutoGameSystem
  18. {
  19. public:
  20. CCSCustomMaterialSwapManager();
  21. virtual ~CCSCustomMaterialSwapManager();
  22. virtual bool Init();
  23. virtual void Shutdown();
  24. bool Process();
  25. void RequestMaterialSwap( EHANDLE hOwner, int nCustomMaterialIndex, ICustomMaterial *pNewCustomMaterialInterface );
  26. void ClearPendingSwaps( EHANDLE hOwner, int nCustomMaterialIndex );
  27. private:
  28. void ClearAllPendingSwaps();
  29. CUtlVector< CCSPendingCustomMaterialSwap_t > m_pPendingSwaps;
  30. };
  31. extern CCSCustomMaterialSwapManager g_CSCustomMaterialSwapManager;
  32. #endif // CS_CUSTOM_MATERIAL_SWAP_H